Skip to content

Commit aa85470

Browse files
Al2Klimovopsiff
authored andcommitted
io_uring/nop: pass all errors to userspace
[ Upstream commit e97ff8b62d4690c69297f0f6de874f0564cc01a4 ] 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: a85f310 ("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> (cherry picked from commit 6836f694126e5dfb44da4f77706ae29e45cc2e1e) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 81a9934 commit aa85470

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

io_uring/nop.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ int io_nop(struct io_kiocb *req, unsigned int issue_flags)
7979
if (ret < 0)
8080
req_set_fail(req);
8181
if (nop->flags & IORING_NOP_CQE32)
82-
io_req_set_res32(req, nop->result, 0, nop->extra1, nop->extra2);
82+
io_req_set_res32(req, ret, 0, nop->extra1, nop->extra2);
8383
else
84-
io_req_set_res(req, nop->result, 0);
84+
io_req_set_res(req, ret, 0);
8585
if (nop->flags & IORING_NOP_TW) {
8686
req->io_task_work.func = io_req_task_complete;
8787
io_req_task_work_add(req);

0 commit comments

Comments
 (0)