Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp574601pxj; Thu, 20 May 2021 16:40:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKMkmNAnrojTw3A+1/YGVPuTvyc3RTMCL1He0vTGwpOyq3giXkqMoVWa8bp7drdq2ELlvA X-Received: by 2002:a5e:a704:: with SMTP id b4mr8429778iod.35.1621554002833; Thu, 20 May 2021 16:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621554002; cv=none; d=google.com; s=arc-20160816; b=DUgTNJKc/fmo1hzWP9K3edsfLygUFwldNPBlB3of/BzY7kY1Sme/SzLmC1s4tPsPUe 6JVVtVkPb63bzfuprRAcc7QxtGxVIV7P0sKEDJVxA3+SfrbSgiGQNEyaks7S4ZSiVi9R 8pLA64LkeE0vmKnonVge73HPAH7OfmjlqmRgjsvCl+QIhoo2Ea8xDR/tlzGhZtga1yiE iT2ooyI0kdChO9cZ7NeXx3kQ8jE4KxswFGiYmaQL8K3qMsbv2CYoib3LoUK5FfadplOB gYqGmeXn2FhDBbcyA+mxwSpTAIhAq0z0uKqYzSmJSL/HY4yhyOWIYB2qsLgDB6LTklkg DG9w== 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=u0/kuY5+SWHNW9+1i/s5C3IYsJPHvuBMcWVMbMl9cNfQ2KG/zq2/3YJ607mtuAw3r8 wnGXfKav33k8rxpDgct+k+2mwPJsPg0wJu/t/R+9rBXDuIkxVhKmRo2M9mT3qtlsY2c1 SPBAbcYlQdotgc5zZTw7/VBdH4/Xz87IuUWe+NMtYXWpgjYGc3XPPoZqFZxxy/w4g/rO iAj6a2QkjPduO4HZhi6bjRYZXIbXpOvpPqePdvaCaG/54395NKFMJvqZdd2wJIHem+0j Nkjw762BjhxumDOHkF7Ufu4fGhlos7Mr2xDSJ02RY8as8Zzp7KSGhjR3yVW+VZJn+5cB VQlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BJTNfv+W; 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 t19si3374800iog.66.2021.05.20.16.39.49; Thu, 20 May 2021 16:40:02 -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=BJTNfv+W; 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 S240871AbhETLcg (ORCPT + 99 others); Thu, 20 May 2021 07:32:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:56404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239728AbhETLL3 (ORCPT ); Thu, 20 May 2021 07:11:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B6D9F61941; Thu, 20 May 2021 10:07:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505254; bh=Iu+n9JsXKTp3CbzqBVUQxZ1DMRkaPClel+mrPh+YlV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BJTNfv+WVyEPNdSTV+ES+aCTVaYeXw3KYJb16ODhoTJw6iHTk2CvVwiroI0ju1Bcg SxrS0uUtFJ3Xv3nJ61839wzG8oxp5ZrpTJ0V+vfQgiBOppPVOHjo1s52+wiPCu1gP8 JzorVMYgONzJ5GOC9b9aIFvoWlYmm+LuRrHhGSHs= 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.4 052/190] dm persistent data: packed struct should have an aligned() attribute too Date: Thu, 20 May 2021 11:21:56 +0200 Message-Id: <20210520092103.898578620@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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,