On Mon, Oct 28, 2024 at 01:52:53PM -0700, Keith Busch wrote: > From: Keith Busch > > 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 > Signed-off-by: Keith Busch > --- > 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