Skip to content

Commit bcb0fda

Browse files
committed
io_uring/rw: ensure reissue path is correctly handled for IOPOLL
The IOPOLL path posts CQEs when the io_kiocb is marked as completed, so it cannot rely on the usual retry that non-IOPOLL requests do for read/write requests. If -EAGAIN is received and the request should be retried, go through the normal completion path and let the normal flush logic catch it and reissue it, like what is done for !IOPOLL reads or writes. Fixes: d803d12 ("io_uring/rw: handle -EAGAIN retry at IO completion time") Reported-by: John Garry <john.g.garry@oracle.com> Link: https://lore.kernel.org/io-uring/2b43ccfa-644d-4a09-8f8f-39ad71810f41@oracle.com/ Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 6ebf051 commit bcb0fda

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

io_uring/rw.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,11 +560,10 @@ static void io_complete_rw_iopoll(struct kiocb *kiocb, long res)
560560
if (kiocb->ki_flags & IOCB_WRITE)
561561
io_req_end_write(req);
562562
if (unlikely(res != req->cqe.res)) {
563-
if (res == -EAGAIN && io_rw_should_reissue(req)) {
563+
if (res == -EAGAIN && io_rw_should_reissue(req))
564564
req->flags |= REQ_F_REISSUE | REQ_F_BL_NO_RECYCLE;
565-
return;
566-
}
567-
req->cqe.res = res;
565+
else
566+
req->cqe.res = res;
568567
}
569568

570569
/* order with io_iopoll_complete() checking ->iopoll_completed */

0 commit comments

Comments
 (0)