[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250809182636.209767-1-sumanth.gavini@yahoo.com>
Date: Sat, 9 Aug 2025 13:26:35 -0500
From: Sumanth Gavini <sumanth.gavini@...oo.com>
To: axboe@...nel.dk,
asml.silence@...il.com
Cc: Sumanth Gavini <sumanth.gavini@...oo.com>,
io-uring@...r.kernel.org,
linux-kernel@...r.kernel.org,
stable@...r.kernel.org,
skhan@...uxfoundation.org,
david.hunter.linux@...il.com,
John Garry <john.g.garry@...cle.com>
Subject: [PATCH 6.6] io_uring/rw: ensure reissue path is correctly handled for IOPOLL
commit bcb0fda3c2da9fe4721d3e73d80e778c038e7d27 upstream.
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: d803d123948f ("io_uring/rw: handle -EAGAIN retry at IO completion time")
Reported-by: John Garry <john.g.garry@...cle.com>
Link: https://lore.kernel.org/io-uring/2b43ccfa-644d-4a09-8f8f-39ad71810f41@oracle.com/
Signed-off-by: Jens Axboe <axboe@...nel.dk>
Signed-off-by: Sumanth Gavini <sumanth.gavini@...oo.com>
---
io_uring/rw.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/io_uring/rw.c b/io_uring/rw.c
index 4ff3442ac2ee..6a84c4a39ce9 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -326,11 +326,10 @@ static void io_complete_rw_iopoll(struct kiocb *kiocb, long res)
if (kiocb->ki_flags & IOCB_WRITE)
io_req_end_write(req);
if (unlikely(res != req->cqe.res)) {
- if (res == -EAGAIN && io_rw_should_reissue(req)) {
+ if (res == -EAGAIN && io_rw_should_reissue(req))
req->flags |= REQ_F_REISSUE | REQ_F_PARTIAL_IO;
- return;
- }
- req->cqe.res = res;
+ else
+ req->cqe.res = res;
}
/* order with io_iopoll_complete() checking ->iopoll_completed */
--
2.43.0
Powered by blists - more mailing lists