summaryrefslogtreecommitdiff
path: root/io_uring
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-07-20 22:16:53 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-11 12:57:45 +0300
commit4d360a819453b0d695372e2f060224191e93177f (patch)
treeae04cd65275ba962cb391701559511cb7bbd5391 /io_uring
parent9164e27c5a8e4ec926133ecd471469a711667dc0 (diff)
downloadlinux-4d360a819453b0d695372e2f060224191e93177f.tar.xz
io_uring: treat -EAGAIN for REQ_F_NOWAIT as final for io-wq
commit a9be202269580ca611c6cebac90eaf1795497800 upstream. io-wq assumes that an issue is blocking, but it may not be if the request type has asked for a non-blocking attempt. If we get -EAGAIN for that case, then we need to treat it as a final result and not retry or arm poll for it. Cc: stable@vger.kernel.org # 5.10+ Link: https://github.com/axboe/liburing/issues/897 Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/io_uring.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index f84584b762d0..c18c4c025da4 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -6895,6 +6895,14 @@ static void io_wq_submit_work(struct io_wq_work *work)
*/
if (ret != -EAGAIN || !(req->ctx->flags & IORING_SETUP_IOPOLL))
break;
+
+ /*
+ * If REQ_F_NOWAIT is set, then don't wait or retry with
+ * poll. -EAGAIN is final for that case.
+ */
+ if (req->flags & REQ_F_NOWAIT)
+ break;
+
cond_resched();
} while (1);
}