From cda5eace1362cd713afc606226b661f461ca2abf Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Wed, 15 Feb 2023 12:16:03 +0100 Subject: [PATCH] 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 --- src/nvme/ioctl.c | 2 ++ 1 file changed, 2 insertions(+) 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. -- 2.49.0