This is a note to let you know that I've just added the patch titled io_uring: treat -EAGAIN for REQ_F_NOWAIT as final for io-wq to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: io_uring-treat-eagain-for-req_f_nowait-as-final-for-io-wq.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From a9be202269580ca611c6cebac90eaf1795497800 Mon Sep 17 00:00:00 2001 From: Jens Axboe <axboe@xxxxxxxxx> Date: Thu, 20 Jul 2023 13:16:53 -0600 Subject: io_uring: treat -EAGAIN for REQ_F_NOWAIT as final for io-wq From: Jens Axboe <axboe@xxxxxxxxx> 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@xxxxxxxxxxxxxxx # 5.10+ Link: https://github.com/axboe/liburing/issues/897 Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- io_uring/io_uring.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -6895,6 +6895,14 @@ static void io_wq_submit_work(struct io_ */ 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); } Patches currently in stable-queue which might be from axboe@xxxxxxxxx are queue-5.10/block-fix-a-source-code-comment-in-include-uapi-linu.patch queue-5.10/io_uring-don-t-audit-the-capability-check-in-io_urin.patch queue-5.10/s390-dasd-fix-hanging-device-after-quiesce-resume.patch queue-5.10/io_uring-treat-eagain-for-req_f_nowait-as-final-for-io-wq.patch