Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp432732pxj; Thu, 20 May 2021 12:45:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziiqhwwC1eLUUoF0UrTxAHuKNlRYZCUqoG+HhRKBXrpr00D83ByCct2HxIycu0ri6rMp/4 X-Received: by 2002:a17:906:3615:: with SMTP id q21mr6374899ejb.414.1621539941541; Thu, 20 May 2021 12:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621539941; cv=none; d=google.com; s=arc-20160816; b=e/IpzKg19ZPqY6eLZFx+UWh/HDTI+XMRi4yIIt6HGxcfGDLAomFLLJaQBMNylcI4GU duAhLB9gbIzff2F2laA3ATL5myuHs3BeuYHB8hKHn0akjRkk1pBU4y3ULQKP2Mgxi5qp GCA8pz930BJZ/g4mIWrwajrmRm8L+zlfk8R3avoyprSUg0XAlh1FVakOVt96khv2iqUQ +IyYUJXJNyqVtccXz/5oKrCvdQEbvaTgl/RIitxSko4NNhsugD8uAJrgDNIcTr3I2xPu HaE1qFa+SIn0fE9CSvyMJqf45b4wOoUd05LHgbWUtmje585EpLGVJoNGug0/tynuTWnx vA3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1Aj37FeapDUP81hqzCDaNIVRtvMlz86FgQmp1M9p6W8=; b=ZR5kguUFLCtMS9XcP2y5gKAYEPBb7NYhvxBY51/fD1APNXjboDfULLfEMMrCfOyB8R LbA3tDjKmyE4JIto8ZVbA2aw54K9gqXZmL/nq7INfT1Dsbwtg0U2/stZOG49/RJ7qQFq 1uQO8o5fxK727FcPopGuzM68szOw7GWcrOifGukwtnGmB3apJAUCfnmjIBPD99qJjtJR FAwLCvg/1Cl1WvRHHaPfH92XUJZ5kdKLe9PCGeF1n/L40Afuq+oo6r8FVvunE7Iz4MoS XpQX42NujOCULBiOrxYrsKPRKRvFj6VtP//5QLwIMYPioonTPCPyKfvD81vnAMjShQu8 01Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j5dZzRM1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si1027096eds.282.2021.05.20.12.45.17; Thu, 20 May 2021 12:45:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j5dZzRM1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237426AbhETKlH (ORCPT + 99 others); Thu, 20 May 2021 06:41:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:55682 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236343AbhETKZj (ORCPT ); Thu, 20 May 2021 06:25:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DCFC761A2D; Thu, 20 May 2021 09:49:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504193; bh=Iu+n9JsXKTp3CbzqBVUQxZ1DMRkaPClel+mrPh+YlV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j5dZzRM1DqMMtA5d/MKZCc9Xka7Gozr8rgHuhVbOp+ZTWqav9y/pu0uX7a/tWje/D 8VKV/kSmu+Uzm0/e9hvMqQ78LKacPqiJdHdrQTtkLIBSIpXMS/eqEvgf82tBnB3a8B MWatLmlBlUoCDAf68oowdwH8bjxHQanWmnkdhJ1A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joe Thornber , Mike Snitzer Subject: [PATCH 4.14 100/323] dm persistent data: packed struct should have an aligned() attribute too Date: Thu, 20 May 2021 11:19:52 +0200 Message-Id: <20210520092123.530007773@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joe Thornber commit a88b2358f1da2c9f9fcc432f2e0a79617fea397c upstream. Otherwise most non-x86 architectures (e.g. riscv, arm) will resort to byte-by-byte access. Cc: stable@vger.kernel.org Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/persistent-data/dm-btree-internal.h | 4 ++-- drivers/md/persistent-data/dm-space-map-common.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) --- a/drivers/md/persistent-data/dm-btree-internal.h +++ b/drivers/md/persistent-data/dm-btree-internal.h @@ -34,12 +34,12 @@ struct node_header { __le32 max_entries; __le32 value_size; __le32 padding; -} __packed; +} __attribute__((packed, aligned(8))); struct btree_node { struct node_header header; __le64 keys[0]; -} __packed; +} __attribute__((packed, aligned(8))); /* --- a/drivers/md/persistent-data/dm-space-map-common.h +++ b/drivers/md/persistent-data/dm-space-map-common.h @@ -33,7 +33,7 @@ struct disk_index_entry { __le64 blocknr; __le32 nr_free; __le32 none_free_before; -} __packed; +} __attribute__ ((packed, aligned(8))); #define MAX_METADATA_BITMAPS 255 @@ -43,7 +43,7 @@ struct disk_metadata_index { __le64 blocknr; struct disk_index_entry index[MAX_METADATA_BITMAPS]; -} __packed; +} __attribute__ ((packed, aligned(8))); struct ll_disk; @@ -86,7 +86,7 @@ struct disk_sm_root { __le64 nr_allocated; __le64 bitmap_root; __le64 ref_count_root; -} __packed; +} __attribute__ ((packed, aligned(8))); #define ENTRIES_PER_BYTE 4 @@ -94,7 +94,7 @@ struct disk_bitmap_header { __le32 csum; __le32 not_used; __le64 blocknr; -} __packed; +} __attribute__ ((packed, aligned(8))); enum allocation_event { SM_NONE,