Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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")
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>

+5 -2
+5 -2
drivers/nvme/host/ioctl.c
··· 421 421 struct io_uring_cmd *ioucmd = req->end_io_data; 422 422 struct nvme_uring_cmd_pdu *pdu = nvme_uring_cmd_pdu(ioucmd); 423 423 424 - if (nvme_req(req)->flags & NVME_REQ_CANCELLED) 424 + if (nvme_req(req)->flags & NVME_REQ_CANCELLED) { 425 425 pdu->status = -EINTR; 426 - else 426 + } else { 427 427 pdu->status = nvme_req(req)->status; 428 + if (!pdu->status) 429 + pdu->status = blk_status_to_errno(err); 430 + } 428 431 pdu->result = le64_to_cpu(nvme_req(req)->result.u64); 429 432 430 433 /*