From: Daniel Wagner Date: Wed, 15 Feb 2023 11:16:03 +0000 (+0100) Subject: ioctl: Set file descriptor in nvme_get_log_page() X-Git-Tag: v1.4~35 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=cda5eace1362cd713afc606226b661f461ca2abf;p=users%2Fsagi%2Flibnvme.git ioctl: Set file descriptor in nvme_get_log_page() We explicitly ask for a file descriptor in the API so use it. The caller might not have set it in args. For example, in nvme-cli when the libnvme wrappers are used to hide the transport details from the nvme-cli core, the macros only pass the file descriptor via the function arguments but don't set it in the arg structs. Signed-off-by: Daniel Wagner --- diff --git a/src/nvme/ioctl.c b/src/nvme/ioctl.c index b2d92efd..2b5e09dd 100644 --- a/src/nvme/ioctl.c +++ b/src/nvme/ioctl.c @@ -438,6 +438,8 @@ int nvme_get_log_page(int fd, __u32 xfer_len, struct nvme_get_log_args *args) void *ptr = args->log; int ret; + args->fd = fd; + /* * 4k is the smallest possible transfer unit, so restricting to 4k * avoids having to check the MDTS value of the controller.