Skip to content

Commit c4b680a

Browse files
isilenceChristoph Hellwig
authored andcommitted
nvme: fix implicit bool to flags conversion
nvme_map_user_request() takes flags as the last argument, but nvme_uring_cmd_io() shoves a bool "vec" into it. It behaves as expected because bool is converted to 0/1 and NVME_IOCTL_VEC is defined as 1, but it's better to pass flags explicitly. Fixes: 7b7fdb8 ("nvme: replace the "bool vec" arguments with flags in the ioctl path") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Reviewed-by: Jens Axboe <axboe@kernel.dk> Reviewed-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Anuj Gupta <anuj20.g@samsung.com> Reviewed-by: Kanchan Joshi <joshi.k@samsung.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Caleb Sander Mateos <csander@purestorage.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 10f4a7c commit c4b680a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/host/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ static int nvme_uring_cmd_io(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
521521
if (d.data_len) {
522522
ret = nvme_map_user_request(req, d.addr, d.data_len,
523523
nvme_to_user_ptr(d.metadata), d.metadata_len,
524-
map_iter, vec);
524+
map_iter, vec ? NVME_IOCTL_VEC : 0);
525525
if (ret)
526526
goto out_free_req;
527527
}

0 commit comments

Comments
 (0)