mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
io_uring/nop: pass all errors to userspace
[ Upstream commite97ff8b62d] This fixes an inconsistency where io_nop() called req_set_fail() based on ret, but passed just nop->result to userspace. Originally, ret is a even copy of nop->result, but is set to an error when such happens subsequently. Now that's also passed to userspace. Fixes:a85f31052b("io_uring/nop: add support for testing registered files and buffers") Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de> Link: https://patch.msgid.link/20260520180045.538533-1-grandmaster@al2klimov.de Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e334cbf338
commit
6836f69412
+2
-2
@@ -79,9 +79,9 @@ done:
|
||||
if (ret < 0)
|
||||
req_set_fail(req);
|
||||
if (nop->flags & IORING_NOP_CQE32)
|
||||
io_req_set_res32(req, nop->result, 0, nop->extra1, nop->extra2);
|
||||
io_req_set_res32(req, ret, 0, nop->extra1, nop->extra2);
|
||||
else
|
||||
io_req_set_res(req, nop->result, 0);
|
||||
io_req_set_res(req, ret, 0);
|
||||
if (nop->flags & IORING_NOP_TW) {
|
||||
req->io_task_work.func = io_req_task_complete;
|
||||
io_req_task_work_add(req);
|
||||
|
||||
Reference in New Issue
Block a user