Skip to content

Commit 5eed4fb

Browse files
committed
nvme: re-fix error-handling for io_uring nvme-passthrough
This was previously fixed with commit 1147dd0 ("nvme: fix error-handling for io_uring nvme-passthrough"), but the change was mistakenly undone in a later commit. Fixes: d6aacee ("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>
1 parent d2f551b commit 5eed4fb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/nvme/host/ioctl.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,13 @@ static enum rq_end_io_ret nvme_uring_cmd_end_io(struct request *req,
421421
struct io_uring_cmd *ioucmd = req->end_io_data;
422422
struct nvme_uring_cmd_pdu *pdu = nvme_uring_cmd_pdu(ioucmd);
423423

424-
if (nvme_req(req)->flags & NVME_REQ_CANCELLED)
424+
if (nvme_req(req)->flags & NVME_REQ_CANCELLED) {
425425
pdu->status = -EINTR;
426-
else
426+
} else {
427427
pdu->status = nvme_req(req)->status;
428+
if (!pdu->status)
429+
pdu->status = blk_status_to_errno(err);
430+
}
428431
pdu->result = le64_to_cpu(nvme_req(req)->result.u64);
429432

430433
/*

0 commit comments

Comments
 (0)