Skip to content

Commit 9b38276

Browse files
rolanddChristoph Hellwig
authored andcommitted
nvme: fix handling of metadata_len for NVME_IOCTL_IO_CMD
The old code in nvme_user_cmd() passed the userspace virtual address from nvme_passthru_cmd.metadata as the length of the metadata buffer as well as the address to nvme_submit_user_cmd(). Fixes: 63263d6 ("nvme: Use metadata for passthrough commands") Signed-off-by: Roland Dreier <[email protected]> Reviewed-by: Keith Busch <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent fa441b7 commit 9b38276

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/host/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@ static int nvme_user_cmd(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
12331233
effects = nvme_passthru_start(ctrl, ns, cmd.opcode);
12341234
status = nvme_submit_user_cmd(ns ? ns->queue : ctrl->admin_q, &c,
12351235
(void __user *)(uintptr_t)cmd.addr, cmd.data_len,
1236-
(void __user *)(uintptr_t)cmd.metadata, cmd.metadata,
1236+
(void __user *)(uintptr_t)cmd.metadata, cmd.metadata_len,
12371237
0, &cmd.result, timeout);
12381238
nvme_passthru_end(ctrl, effects);
12391239

0 commit comments

Comments
 (0)