From 15a2a84e96427eab33e5c33ee3af4fc969619a7e Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 13 Jan 2022 15:23:02 +0100 Subject: [PATCH] ioctl: Rearrange members in nvme_get_lba_status_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_get_lba_status_args { int args_size; /* 0 4 */ int fd; /* 4 4 */ __u32 * result; /* 8 8 */ __u32 timeout; /* 16 4 */ __u32 nsid; /* 20 4 */ __u32 mndw; /* 24 4 */ enum nvme_lba_status_atype atype; /* 28 4 */ __u64 slba; /* 32 8 */ struct nvme_lba_status * lbas; /* 40 8 */ __u16 rl; /* 48 2 */ /* size: 50, cachelines: 1, members: 10 */ /* last cacheline: 50 bytes */ } __attribute__((__packed__)); Signed-off-by: Daniel Wagner --- src/nvme/ioctl.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/nvme/ioctl.h b/src/nvme/ioctl.h index 7e062b63..b219e15f 100644 --- a/src/nvme/ioctl.h +++ b/src/nvme/ioctl.h @@ -3009,28 +3009,28 @@ int nvme_security_receive(struct nvme_security_receive_args *args); /** * nvme_get_lba_status_args - Arguments for the NVMe Get LBA Status command * @fd: File descriptor of nvme device + * @result: The command completion result from CQE dword0 + * @timeout: Timeout in ms * @nsid: Namespace ID to retrieve LBA status - * @slba: Starting logical block address to check statuses * @mndw: Maximum number of dwords to return * @atype: Action type mechanism to determine LBA status desctriptors to - * return, see &enum nvme_lba_status_atype - * @rl: Range length from slba to perform the action - * @timeout: Timeout in ms + * return, see &enum nvme_lba_status_atype + * @slba: Starting logical block address to check statuses * @lbas: Data payload to return status descriptors - * @result: The command completion result from CQE dword0 + * @rl: Range length from slba to perform the action */ struct nvme_get_lba_status_args { int args_size; int fd; + __u32 *result; + __u32 timeout; __u32 nsid; - __u64 slba; __u32 mndw; - __u16 rl; enum nvme_lba_status_atype atype; - __u32 timeout; + __u64 slba; struct nvme_lba_status *lbas; - __u32 *result; -}; + __u16 rl; +} __attribute__((__packed__)); /** * nvme_get_lba_status() - Retrieve information on possibly unrecoverable LBAs -- 2.50.1