Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: re-fix error-handling for io_uring nvme-passthrough
@ 2024-10-28 20:52 ` Keith Busch
  2024-10-28 20:54   ` Jens Axboe
                     ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Keith Busch @ 2024-10-28 20:52 UTC (permalink / raw)
  To: linux-nvme, hch; +Cc: anuj20.g, Keith Busch, Jens Axboe

From: Keith Busch <kbusch@kernel.org>

This was previously fixed with commit 1147dd0503564fa0e0348
("nvme: fix error-handling for io_uring nvme-passthrough"), but the
change was mistakenly undone in a later commit.

Fixes: d6aacee9255e7f ("nvme: use bio_integrity_map_user"
Reported-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 drivers/nvme/host/ioctl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
index b9b79ccfabf8a..6c531088043b7 100644
--- a/drivers/nvme/host/ioctl.c
+++ b/drivers/nvme/host/ioctl.c
@@ -422,9 +422,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);
 
 	if (nvme_req(req)->flags & NVME_REQ_CANCELLED)
+	if (nvme_req(req)->flags & NVME_REQ_CANCELLED) {
 		pdu->status = -EINTR;
-	else
+	} else {
 		pdu->status = nvme_req(req)->status;
+		if (!pdu->status)
+			pdu->status = blk_status_to_errno(err);
+	}
 	pdu->result = le64_to_cpu(nvme_req(req)->result.u64);
 
 	/*
-- 
2.43.5



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] nvme: re-fix error-handling for io_uring nvme-passthrough
  2024-10-28 20:52 ` [PATCH] nvme: re-fix error-handling for io_uring nvme-passthrough Keith Busch
@ 2024-10-28 20:54   ` Jens Axboe
  2024-10-29  4:25   ` Kanchan Joshi
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2024-10-28 20:54 UTC (permalink / raw)
  To: Keith Busch, linux-nvme, hch; +Cc: anuj20.g, Keith Busch

On 10/28/24 2:52 PM, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
> 
> This was previously fixed with commit 1147dd0503564fa0e0348
> ("nvme: fix error-handling for io_uring nvme-passthrough"), but the
> change was mistakenly undone in a later commit.
> 
> Fixes: d6aacee9255e7f ("nvme: use bio_integrity_map_user"
> Reported-by: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Keith Busch <kbusch@kernel.org>

Looks good to me, but needs a:

Cc: stable@vger.kernel.org

to ensure it hits stable as well.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nvme: re-fix error-handling for io_uring nvme-passthrough
  2024-10-28 20:52 ` [PATCH] nvme: re-fix error-handling for io_uring nvme-passthrough Keith Busch
  2024-10-28 20:54   ` Jens Axboe
@ 2024-10-29  4:25   ` Kanchan Joshi
  2024-10-29  4:42   ` Anuj Gupta
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kanchan Joshi @ 2024-10-29  4:25 UTC (permalink / raw)
  To: Keith Busch, linux-nvme, hch; +Cc: anuj20.g, Keith Busch, Jens Axboe

On 10/29/2024 2:22 AM, Keith Busch wrote:
> From: Keith Busch<kbusch@kernel.org>
> 
> This was previously fixed with commit 1147dd0503564fa0e0348
> ("nvme: fix error-handling for io_uring nvme-passthrough"), but the
> change was mistakenly undone in a later commit.
> 
> Fixes: d6aacee9255e7f ("nvme: use bio_integrity_map_user"

Looks good.
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nvme: re-fix error-handling for io_uring nvme-passthrough
  2024-10-28 20:52 ` [PATCH] nvme: re-fix error-handling for io_uring nvme-passthrough Keith Busch
  2024-10-28 20:54   ` Jens Axboe
  2024-10-29  4:25   ` Kanchan Joshi
@ 2024-10-29  4:42   ` Anuj Gupta
  2024-10-29  7:39   ` Christoph Hellwig
  2024-10-29 13:46   ` Keith Busch
  4 siblings, 0 replies; 6+ messages in thread
From: Anuj Gupta @ 2024-10-29  4:42 UTC (permalink / raw)
  To: Keith Busch; +Cc: linux-nvme, hch, Keith Busch, Jens Axboe

[-- Attachment #1: Type: text/plain, Size: 1285 bytes --]

On Mon, Oct 28, 2024 at 01:52:53PM -0700, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
> 
> This was previously fixed with commit 1147dd0503564fa0e0348
> ("nvme: fix error-handling for io_uring nvme-passthrough"), but the
> change was mistakenly undone in a later commit.
> 
> Fixes: d6aacee9255e7f ("nvme: use bio_integrity_map_user"
> Reported-by: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
>  drivers/nvme/host/ioctl.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
> index b9b79ccfabf8a..6c531088043b7 100644
> --- a/drivers/nvme/host/ioctl.c
> +++ b/drivers/nvme/host/ioctl.c
> @@ -422,9 +422,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);
>  
>  	if (nvme_req(req)->flags & NVME_REQ_CANCELLED)
> +	if (nvme_req(req)->flags & NVME_REQ_CANCELLED) {
>  		pdu->status = -EINTR;
> -	else
> +	} else {
>  		pdu->status = nvme_req(req)->status;
> +		if (!pdu->status)
> +			pdu->status = blk_status_to_errno(err);
> +	}
>  	pdu->result = le64_to_cpu(nvme_req(req)->result.u64);
>  
>  	/*
> -- 
> 2.43.5

Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nvme: re-fix error-handling for io_uring nvme-passthrough
  2024-10-28 20:52 ` [PATCH] nvme: re-fix error-handling for io_uring nvme-passthrough Keith Busch
                     ` (2 preceding siblings ...)
  2024-10-29  4:42   ` Anuj Gupta
@ 2024-10-29  7:39   ` Christoph Hellwig
  2024-10-29 13:46   ` Keith Busch
  4 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2024-10-29  7:39 UTC (permalink / raw)
  To: Keith Busch; +Cc: linux-nvme, hch, anuj20.g, Keith Busch, Jens Axboe

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nvme: re-fix error-handling for io_uring nvme-passthrough
  2024-10-28 20:52 ` [PATCH] nvme: re-fix error-handling for io_uring nvme-passthrough Keith Busch
                     ` (3 preceding siblings ...)
  2024-10-29  7:39   ` Christoph Hellwig
@ 2024-10-29 13:46   ` Keith Busch
  4 siblings, 0 replies; 6+ messages in thread
From: Keith Busch @ 2024-10-29 13:46 UTC (permalink / raw)
  To: Keith Busch; +Cc: linux-nvme, hch, anuj20.g, Jens Axboe

On Mon, Oct 28, 2024 at 01:52:53PM -0700, Keith Busch wrote:
> @@ -422,9 +422,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);
>  
>  	if (nvme_req(req)->flags & NVME_REQ_CANCELLED)
> +	if (nvme_req(req)->flags & NVME_REQ_CANCELLED) {

There should have been a '-' sign in front of that first if statement.
Fixed up and pushed to nvme-6.12.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-10-29 14:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20241028211654epcas5p19ea63d394a4faea81e54514ac6252271@epcas5p1.samsung.com>
2024-10-28 20:52 ` [PATCH] nvme: re-fix error-handling for io_uring nvme-passthrough Keith Busch
2024-10-28 20:54   ` Jens Axboe
2024-10-29  4:25   ` Kanchan Joshi
2024-10-29  4:42   ` Anuj Gupta
2024-10-29  7:39   ` Christoph Hellwig
2024-10-29 13:46   ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox