Skip to content

Commit 1b48773

Browse files
isilenceaxboe
authored andcommitted
io_uring: fix io_drain_req()
io_drain_req() return whether the request has been consumed or not, not an error code. Fix a stupid mistake slipped from optimisation patches. Reported-by: [email protected] Fixes: 76cc33d ("io_uring: refactor io_req_defer()") Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/4d3c53c4274ffff307c8ae062fc7fda63b978df2.1626039606.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 9c68826 commit 1b48773

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/io_uring.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6019,11 +6019,13 @@ static bool io_drain_req(struct io_kiocb *req)
60196019

60206020
ret = io_req_prep_async(req);
60216021
if (ret)
6022-
return ret;
6022+
goto fail;
60236023
io_prep_async_link(req);
60246024
de = kmalloc(sizeof(*de), GFP_KERNEL);
60256025
if (!de) {
6026-
io_req_complete_failed(req, -ENOMEM);
6026+
ret = -ENOMEM;
6027+
fail:
6028+
io_req_complete_failed(req, ret);
60276029
return true;
60286030
}
60296031

0 commit comments

Comments
 (0)