Skip to content

Commit 3f0cb8d

Browse files
isilenceaxboe
authored andcommitted
io_uring: fix retry handling off iowq
io_req_complete_post() doesn't handle reissue and if called with a REQ_F_REISSUE request it might post extra unexpected completions. Fix it by pushing into flush_completion via task work. Fixes: d803d12 ("io_uring/rw: handle -EAGAIN retry at IO completion time") Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/badb3d7e462881e7edbfcc2be6301090b07dbe53.1742829388.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 8e3100f commit 3f0cb8d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ static void io_req_complete_post(struct io_kiocb *req, unsigned issue_flags)
904904
* Handle special CQ sync cases via task_work. DEFER_TASKRUN requires
905905
* the submitter task context, IOPOLL protects with uring_lock.
906906
*/
907-
if (ctx->lockless_cq) {
907+
if (ctx->lockless_cq || (req->flags & REQ_F_REISSUE)) {
908908
req->io_task_work.func = io_req_task_complete;
909909
io_req_task_work_add(req);
910910
return;

0 commit comments

Comments
 (0)