[PATCH 2/3] io_uring: clear REQ_F_FORCE_ASYNC when reissuing a request
From: Yun Wang
Date: Sun Nov 29 2026 - 13:33:55 EST
When a read or write is reissued, io_free_batch_list() clears
REQ_F_REISSUE and queues the request to io-wq, but leaves
REQ_F_FORCE_ASYNC set. For a request submitted with IOSQE_ASYNC on a
file that implements ->poll(), io_wq_submit_work() then issues it with
IO_URING_F_NONBLOCK again, so the retry that should be blocking is
another nonblocking attempt with IOCB_NOWAIT set. io_rw_should_reissue()
allows a reissue after a nonblocking attempt, so such a request is
still reissued forever when its completion keeps returning -EAGAIN or
-EOPNOTSUPP.
REQ_F_REISSUE means the nonblocking attempt has been made and the
request should now be issued from blocking context. Clear
REQ_F_FORCE_ASYNC together with it, so that io-wq issues the retry
blocking. The request is already being queued to io-wq at this point;
the only other effect is that the retry no longer sets
IO_WQ_WORK_CONCURRENT.
FUSE regular files implement ->poll(). With a FUSE server that has
FUSE_ASYNC_DIO and FOPEN_DIRECT_IO and answers every READ with
-EOPNOTSUPP or -EAGAIN, an IORING_OP_READ with IOSQE_ASYNC is still
reissued until the server stops failing with the previous patch alone.
With both patches it fails after two attempts.
Fixes: d803d123948f ("io_uring/rw: handle -EAGAIN retry at IO completion time")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Yun Wang <arsenova@xxxxxxxxx>
---
io_uring/io_uring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 5db57bf675f0..c08714d10d5b 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1187,7 +1187,7 @@ static void io_free_batch_list(struct io_ring_ctx *ctx,
if (unlikely(req->flags & IO_REQ_CLEAN_SLOW_FLAGS)) {
if (req->flags & REQ_F_REISSUE) {
node = req->comp_list.next;
- req->flags &= ~REQ_F_REISSUE;
+ req->flags &= ~(REQ_F_REISSUE | REQ_F_FORCE_ASYNC);
io_queue_iowq(req);
continue;
}
--
2.56.1