From: Sumanth Gavini <sumanth.gavini@yahoo.com>
To: axboe@kernel.dk, asml.silence@gmail.com, lkp@intel.com
Cc: Sumanth Gavini <sumanth.gavini@yahoo.com>,
io-uring@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, skhan@linuxfoundation.org,
david.hunter.linux@gmail.com, oe-kbuild-all@lists.linux.dev,
John Garry <john.g.garry@oracle.com>
Subject: [PATCH v2 6.6] io_uring/rw: ensure reissue path is correctly handled for IOPOLL
Date: Sat, 9 Aug 2025 15:54:18 -0500 [thread overview]
Message-ID: <20250809205420.214099-1-sumanth.gavini@yahoo.com> (raw)
In-Reply-To: <aJeVj4yXt4F01nPb@f5c43a121a53>
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@oracle.com>
Link: https://lore.kernel.org/io-uring/2b43ccfa-644d-4a09-8f8f-39ad71810f41@oracle.com/
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sumanth Gavini <sumanth.gavini@yahoo.com>
---
Changes in v2:
- Removed the extra space before commit-id in message, No codes changes
- Link to v1:https://lore.kernel.org/all/20250809182636.209767-1-sumanth.gavini@yahoo.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
next parent reply other threads:[~2025-08-09 21:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <aJeVj4yXt4F01nPb@f5c43a121a53>
2025-08-09 20:54 ` Sumanth Gavini [this message]
2025-08-12 10:49 ` [PATCH v2 6.6] io_uring/rw: ensure reissue path is correctly handled for IOPOLL Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250809205420.214099-1-sumanth.gavini@yahoo.com \
--to=sumanth.gavini@yahoo.com \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=david.hunter.linux@gmail.com \
--cc=io-uring@vger.kernel.org \
--cc=john.g.garry@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=skhan@linuxfoundation.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox