Skip to content

Commit 425b9ce

Browse files
committed
ioctl: Rearrange members in nvme_get_property_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_property_args { int args_size; /* 0 4 */ int fd; /* 4 4 */ __u64 * value; /* 8 8 */ __u32 timeout; /* 16 4 */ int offset; /* 20 4 */ /* size: 24, cachelines: 1, members: 5 */ /* last cacheline: 24 bytes */ } __attribute__((__aligned__(8))); Signed-off-by: Daniel Wagner <[email protected]>
1 parent 3bca40d commit 425b9ce

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/nvme/ioctl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3398,17 +3398,17 @@ int nvme_set_property(struct nvme_set_property_args *args);
33983398
/**
33993399
* nvme_get_property_args - Arguments for NVMe Get Property command
34003400
* @fd: File descriptor of nvme device
3401-
* @offset: Property offset from the base to retrieve
34023401
* @value: Where the property's value will be stored on success
3402+
* @offset: Property offset from the base to retrieve
34033403
* @timeout: Timeout in ms
34043404
*/
34053405
struct nvme_get_property_args {
34063406
int args_size;
34073407
int fd;
3408-
int offset;
34093408
__u64 *value;
34103409
__u32 timeout;
3411-
};
3410+
int offset;
3411+
} __attribute__((packed, aligned(__alignof__(__u64*))));
34123412

34133413
/**
34143414
* nvme_get_property() - Get a controller property

0 commit comments

Comments
 (0)