nvme: re-fix error-handling for io_uring nvme-passthrough

BugLink: https://bugs.launchpad.net/bugs/2099996

[ Upstream commit 5eed4fb274cd6579f2fb4190b11c4c86c553cd06 ]

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

Fixes: d6aacee925 ("nvme: use bio_integrity_map_user")
Cc: stable@vger.kernel.org
Reported-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
Keith Busch
2025-02-25 22:59:22 +09:00
committed by Stefan Bader
parent 1101ad689c
commit a20dfec661
+5 -2
View File
@@ -422,10 +422,13 @@ static enum rq_end_io_ret nvme_uring_cmd_end_io(struct request *req,
struct io_uring_cmd *ioucmd = req->end_io_data;
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);
/*