From a4304bc7a9302ac6fb2e09cb3c01b6d55c8c97ba Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 13 Jan 2022 18:56:22 +0100 Subject: [PATCH] ioctl: Rearrange members in nvme_resv_register_args Avoid any holes in the struct by rearranging the members. Also add the attribute packed to struct definition to reduce ABI breakage. struct nvme_resv_register_args { int args_size; /* 0 4 */ int fd; /* 4 4 */ __u32 * result; /* 8 8 */ __u32 timeout; /* 16 4 */ __u32 nsid; /* 20 4 */ enum nvme_resv_rrega rrega; /* 24 4 */ enum nvme_resv_cptpl cptpl; /* 28 4 */ __u64 crkey; /* 32 8 */ __u64 nrkey; /* 40 8 */ _Bool iekey; /* 48 1 */ /* size: 56, cachelines: 1, members: 10 */ /* padding: 7 */ /* last cacheline: 56 bytes */ } __attribute__((__aligned__(8))); Signed-off-by: Daniel Wagner --- src/nvme/ioctl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nvme/ioctl.h b/src/nvme/ioctl.h index 24fd59de..5978a39e 100644 --- a/src/nvme/ioctl.h +++ b/src/nvme/ioctl.h @@ -3847,15 +3847,15 @@ int nvme_resv_acquire(struct nvme_resv_acquire_args *args); struct nvme_resv_register_args { int args_size; int fd; + __u32 *result; + __u32 timeout; __u32 nsid; enum nvme_resv_rrega rrega; enum nvme_resv_cptpl cptpl; - bool iekey; __u64 crkey; __u64 nrkey; - __u32 timeout; - __u32 *result; -}; + bool iekey; +} __attribute__((packed, aligned(__alignof__(__u64)))); /** * nvme_resv_register() - Send an nvme reservation register -- 2.50.1