* [PATCH v2] nvme: fix error-handling for io_uring nvme-passthrough
[not found] <CGME20231018193056epcas5p404b1fb38d3e9037862703690336d2d10@epcas5p4.samsung.com>
@ 2023-10-18 19:24 ` Kanchan Joshi
2023-10-19 5:33 ` Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Kanchan Joshi @ 2023-10-18 19:24 UTC (permalink / raw)
To: hch, kbusch, axboe, Niklas.Cassel
Cc: linux-nvme, gost.dev, joshiiitr, Anuj Gupta, Kanchan Joshi
From: Anuj Gupta <anuj20.g@samsung.com>
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 <anuj20.g@samsung.com>
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
---
Changes since v1:
- Coding and comment style change (Niklas)
drivers/nvme/host/ioctl.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
index d8ff796fd5f2..92273a5a2202 100644
--- a/drivers/nvme/host/ioctl.c
+++ b/drivers/nvme/host/ioctl.c
@@ -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);
/*
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] nvme: fix error-handling for io_uring nvme-passthrough
2023-10-18 19:24 ` [PATCH v2] nvme: fix error-handling for io_uring nvme-passthrough Kanchan Joshi
@ 2023-10-19 5:33 ` Christoph Hellwig
2023-10-19 7:38 ` Niklas Cassel
2023-11-06 5:40 ` Kanchan Joshi
2 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2023-10-19 5:33 UTC (permalink / raw)
To: Kanchan Joshi
Cc: hch, kbusch, axboe, Niklas.Cassel, linux-nvme, gost.dev,
joshiiitr, Anuj Gupta
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] nvme: fix error-handling for io_uring nvme-passthrough
2023-10-18 19:24 ` [PATCH v2] nvme: fix error-handling for io_uring nvme-passthrough Kanchan Joshi
2023-10-19 5:33 ` Christoph Hellwig
@ 2023-10-19 7:38 ` Niklas Cassel
2023-11-06 5:40 ` Kanchan Joshi
2 siblings, 0 replies; 5+ messages in thread
From: Niklas Cassel @ 2023-10-19 7:38 UTC (permalink / raw)
To: Kanchan Joshi
Cc: hch@lst.de, kbusch@kernel.org, axboe@kernel.dk,
linux-nvme@lists.infradead.org, gost.dev@samsung.com,
joshiiitr@gmail.com, Anuj Gupta
On Thu, Oct 19, 2023 at 12:54:30AM +0530, Kanchan Joshi wrote:
> From: Anuj Gupta <anuj20.g@samsung.com>
>
> 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 <anuj20.g@samsung.com>
> Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
> ---
> Changes since v1:
> - Coding and comment style change (Niklas)
>
> drivers/nvme/host/ioctl.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
> index d8ff796fd5f2..92273a5a2202 100644
> --- a/drivers/nvme/host/ioctl.c
> +++ b/drivers/nvme/host/ioctl.c
> @@ -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);
>
> /*
> --
> 2.25.1
>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] nvme: fix error-handling for io_uring nvme-passthrough
2023-10-18 19:24 ` [PATCH v2] nvme: fix error-handling for io_uring nvme-passthrough Kanchan Joshi
2023-10-19 5:33 ` Christoph Hellwig
2023-10-19 7:38 ` Niklas Cassel
@ 2023-11-06 5:40 ` Kanchan Joshi
2023-11-06 15:52 ` Keith Busch
2 siblings, 1 reply; 5+ messages in thread
From: Kanchan Joshi @ 2023-11-06 5:40 UTC (permalink / raw)
To: hch, kbusch, axboe, Niklas.Cassel
Cc: linux-nvme, gost.dev, joshiiitr, Anuj Gupta
Keith,
Can this be picked?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] nvme: fix error-handling for io_uring nvme-passthrough
2023-11-06 5:40 ` Kanchan Joshi
@ 2023-11-06 15:52 ` Keith Busch
0 siblings, 0 replies; 5+ messages in thread
From: Keith Busch @ 2023-11-06 15:52 UTC (permalink / raw)
To: Kanchan Joshi
Cc: hch, axboe, Niklas.Cassel, linux-nvme, gost.dev, joshiiitr,
Anuj Gupta
On Mon, Nov 06, 2023 at 11:10:24AM +0530, Kanchan Joshi wrote:
> Keith,
>
> Can this be picked?
Got it queued up now, thank you for the reminder.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-11-06 15:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20231018193056epcas5p404b1fb38d3e9037862703690336d2d10@epcas5p4.samsung.com>
2023-10-18 19:24 ` [PATCH v2] nvme: fix error-handling for io_uring nvme-passthrough Kanchan Joshi
2023-10-19 5:33 ` Christoph Hellwig
2023-10-19 7:38 ` Niklas Cassel
2023-11-06 5:40 ` Kanchan Joshi
2023-11-06 15:52 ` Keith Busch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox