Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2490371pxj; Mon, 10 May 2021 04:21:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEGWAfw3ZufG0o85IOQ1aYlb/SB62BPXhAxANbUA0VRdgTy+ODmGa8UJNXSHigDhViolL6 X-Received: by 2002:a17:906:1f54:: with SMTP id d20mr6650801ejk.94.1620645713140; Mon, 10 May 2021 04:21:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645713; cv=none; d=google.com; s=arc-20160816; b=l6ASG1SP4If2dvaYqd+NbEuCJrWpqabnXAdhzNvLtHGIOYU+lXIdRnRvzLDjMzLFUu HxIAYLOjr9hQgOCc/kG1EaYz+srfZFQXtJcwyDwHkFgpgCi5nOCQr0QmMB50TdYqNE2r o1HXs1WyPehOgHN+UlsVmVOHO0OPEbQVgOPMW76yHhnwaGwB6TujwutqI/mLJBMg2tXh 3Akri1mNgehuhP7uXnsBF220kpepZPCarIlpwMrtyLaIrUNOWEv8MKZ0wQbo789Wotdp gLB3e9pmdLSBvDiLMl2b09lFJWQiSHiyNYLWn/cYXXkwbQXhRpP+cI+xgIJmSkgeriaq tMlA== 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=+rRvaC4cH2EqxKIUTV+uJLnMn706AQxsRsciOpYFR9k=; b=N12AOhmnvBkoKKgmKQTrfgEnWwCTXygjHusnhQxrSnBucQsj7lYAMWhM2YRVNxa7c8 Sf+lNuxAyW13StCa3PG85xzglCGXGet7mJ44NMixPiurHwFFgRXMAORixRlGXNAdw8Yw wbhbrS5OAqnCpiz+B8+WacN60YsfGgAJEH/hqn+ZJrmq0K6VubOmf5fZbYjD1PLOsZYy 5om3jYInYGlRb7oRLFlfqCJ234IWIdD+VAjf85ZOHXoxX5NUidppZE6RAjId73DGylU9 rJvOTfG+tzV+YgoT9fJLiUrlTeQU+ezOPUKDBO+LjqCBuWNS5qK17YLRTFI4YbTpfEgR sVGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gZWIh6ZB; 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 e23si13387187ejt.510.2021.05.10.04.21.29; Mon, 10 May 2021 04:21:53 -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=gZWIh6ZB; 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 S232431AbhEJLSy (ORCPT + 99 others); Mon, 10 May 2021 07:18:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:53024 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233978AbhEJKzl (ORCPT ); Mon, 10 May 2021 06:55:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0439C61C1A; Mon, 10 May 2021 10:43:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643384; bh=Ll8FqHKYmyisncPLSUPpnG4ut9uGKguVRFBpQkyUufk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gZWIh6ZBeTt0/FeyDx6OS4UNyBKzFRS9VLBGzmbRBcyOzSYyXqqNswxuEXaNKoc7b dByZqCub8aMCI4wVOCRAqqDQy55m2a3/WK9bqldCgP4sCCOzFNWEnERMm77GRO8UaT SjC8m68iJb2zOluq3HOcpnwpnjsmlhQiW+fNzugI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joe Thornber , Mike Snitzer Subject: [PATCH 5.10 293/299] dm persistent data: packed struct should have an aligned() attribute too Date: Mon, 10 May 2021 12:21:30 +0200 Message-Id: <20210510102014.610057806@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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[]; -} __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,