Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp305117pxj; Thu, 20 May 2021 09:42:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKZoK3xjJrtk7vtZBw6FLMDVgVaeXz25+qwe1cOVGb1fknYxxE1vv3G0O1ck5UBU6cAI4C X-Received: by 2002:a05:6402:1548:: with SMTP id p8mr5938511edx.261.1621528974487; Thu, 20 May 2021 09:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621528974; cv=none; d=google.com; s=arc-20160816; b=T1+UXQrqukQ9Y+YragDO2y15N84wxCPdwFkSb7IA+4PLxo3x3EGif9XJ81mZBW3GkF Gn6FEAzkEF8LaSqfo16Qo//zqG0eyk8AXkMKBnSK3snhLS1NGqUvTzhbn6YNkMhdPNI5 HgUMVX2Z9NyZwX+uDI1bhd7romvpJ0O9lvsXASWrb294FheJjUOxxM0FQVCzXOl8L3Ns 7gPqMTVubYyZD4ZAbQwGNqydb2HvtepTEjW3kCq1poHHG2Amc3pnrJAyXSve16wBekYa RejVMGtX83YdVQ672cK49+BmareZ9VeA4Vvrtttg0bE2rhXPGt6nFhK/ct+I2gFUOy1L CQGA== 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=W0ETsvKRIzwMwwSfovuBXFN+OLyyAC7IH6c1yydwLNF6ZkcbzMthVj32uZlYCz+aHl ccDTXj29n+bI85SyfscmmgmD/viFOUBxJqyFGkRkzveah+OvFfF+bd021CRcLiRMR0rY NsMCkk9zRXqBfgtLGMkN7FMPLQha2vQICQNMP93x4MxDTDxooFNahi6xkXcjvT5SdUr5 ypEG+lMfQuQHSprfoUxumgWXzRRa3Z849UooP1Y7twgj1u/K0kFgChQGnWS8aO6QJvQo rLquvgulmC4HsXny/p9NbRKlqm9Wmd4UUd6Dexo8Cre0I9k0CHnGz+4IMhrzjb8bav1G onpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wj1kczWe; 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 w21si2319491edx.284.2021.05.20.09.42.30; Thu, 20 May 2021 09:42:54 -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=wj1kczWe; 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 S234053AbhETJrj (ORCPT + 99 others); Thu, 20 May 2021 05:47:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:47818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233945AbhETJoj (ORCPT ); Thu, 20 May 2021 05:44:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 652C56144D; Thu, 20 May 2021 09:33:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503203; bh=Iu+n9JsXKTp3CbzqBVUQxZ1DMRkaPClel+mrPh+YlV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wj1kczWexv5I9hPHC01LIgxKlZg6LVhwkuG0kVFyO0WSnuB8vJGJSjWgZL0ABoIxb a3HPBdiJwjnJCGsE8VzME2LG/7Wi07M+x82FOxIoOpuDyA5bULbevRc26qQ2u/Hj2C UJfaGb8NLdZZJirqDJccnnga/iwB190pm+RShT7g= 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.19 116/425] dm persistent data: packed struct should have an aligned() attribute too Date: Thu, 20 May 2021 11:18:05 +0200 Message-Id: <20210520092135.257703968@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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,