summaryrefslogtreecommitdiff
path: root/drivers/md/persistent-data/dm-btree-internal.h
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2021-03-29 18:34:57 +0300
committerMike Snitzer <snitzer@redhat.com>2021-04-19 19:48:12 +0300
commita88b2358f1da2c9f9fcc432f2e0a79617fea397c (patch)
tree5333c8be50e3ecc219eab786eb788385e7fe63ff /drivers/md/persistent-data/dm-btree-internal.h
parentf73e2e70ec48c9a9d45494c4866230a5059062ad (diff)
downloadlinux-a88b2358f1da2c9f9fcc432f2e0a79617fea397c.tar.xz
dm persistent data: packed struct should have an aligned() attribute too
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 <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/persistent-data/dm-btree-internal.h')
-rw-r--r--drivers/md/persistent-data/dm-btree-internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/persistent-data/dm-btree-internal.h b/drivers/md/persistent-data/dm-btree-internal.h
index d0c55916daa9..b1788853a355 100644
--- 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)));
/*