nvme: fix error-handling for io_uring nvme-passthrough
A message that is not in the archive (sent off-list or not yet received): CGME20231018193056epcas5p404b1fb38d3e9037862703690336d2d10@epcas5p4.samsung.com
PATCH v2 1/1 nvme: fix error-handling for io_uring nvme-passthrough
From: Anuj Gupta <[email protected]>
Driver may return an error before submitting the command to the device. Ensure that such error is propagated up.
---
Changes since v1:
- Coding and comment style change (Niklas)
drivers/nvme/host/ioctl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/nvme/host/ioctl.c +5 -2
@@ -506,10 +506,13 @@ static enum rq_end_io_ret nvme_uring_cmd_end_io(struct request *req,struct nvme_uring_cmd_pdu *pdu =nvme_uring_cmd_pdu (ioucmd); req->bio = pdu->bio; -if (nvme_req (req)->flags &NVME_REQ_CANCELLED ) +if (nvme_req (req)->flags &NVME_REQ_CANCELLED ) { pdu->nvme_status = -EINTR ; -else + }else { pdu->nvme_status =nvme_req (req)->status; +if (!pdu->nvme_status) + pdu->nvme_status =blk_status_to_errno (err); + } pdu->u.result =le64_to_cpu (nvme_req (req)->result.u64);/*
Signature · 1 line
2.25.1
Looks good:
Quoted 38 lines · Kanchan Joshi
From: Anuj Gupta <[email protected]>
Driver may return an error before submitting the command to the device. Ensure that such error is propagated up.
Fixes 456cba386e94 ("nvme: wire-up uring-cmd support for io-passthru on char-device.")Signed-off-by Anuj Gupta <[email protected]>Signed-off-by Kanchan Joshi <[email protected]>---
Changes since v1:
- Coding and comment style change (Niklas)drivers/nvme/host/ioctl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/nvme/host/ioctl.c +5
-2@@ -506,10 +506,13 @@ static enum rq_end_io_ret nvme_uring_cmd_end_io(struct request *req,struct nvme_uring_cmd_pdu *pdu =nvme_uring_cmd_pdu (ioucmd); req->bio = pdu->bio; -if (nvme_req (req)->flags &NVME_REQ_CANCELLED ) +if (nvme_req (req)->flags &NVME_REQ_CANCELLED ) { pdu->nvme_status = -EINTR ; -else + }else { pdu->nvme_status =nvme_req (req)->status; +if (!pdu->nvme_status) + pdu->nvme_status =blk_status_to_errno (err); + } pdu->u.result =le64_to_cpu (nvme_req (req)->result.u64);/* Signature · 1 line
2.25.1
Keith,
Can this be picked?
Keith Busch
maintainerQuoted 3 lines · Kanchan Joshi
Keith,
Can this be picked?
Got it queued up now, thank you for the reminder.