]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Aug 2023 08:07:14 +0000 (10:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Aug 2023 08:07:14 +0000 (10:07 +0200)
added patches:
io_uring-treat-eagain-for-req_f_nowait-as-final-for-io-wq.patch

queue-5.15/io_uring-treat-eagain-for-req_f_nowait-as-final-for-io-wq.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/io_uring-treat-eagain-for-req_f_nowait-as-final-for-io-wq.patch b/queue-5.15/io_uring-treat-eagain-for-req_f_nowait-as-final-for-io-wq.patch
new file mode 100644 (file)
index 0000000..d6b29dc
--- /dev/null
@@ -0,0 +1,39 @@
+From a9be202269580ca611c6cebac90eaf1795497800 Mon Sep 17 00:00:00 2001
+From: Jens Axboe <axboe@kernel.dk>
+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@kernel.dk>
+
+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>
+---
+ io_uring/io_uring.c |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/io_uring/io_uring.c
++++ b/io_uring/io_uring.c
+@@ -7066,6 +7066,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);
+       }
index 02d989521145ea340713bcc5fb0b649ab8ac7e61..958e7cbe17a9f65ab371900c09cc4b5a7cd893e6 100644 (file)
@@ -150,3 +150,4 @@ acpi-processor-perflib-use-the-no-limit-frequency-qos.patch
 acpi-processor-perflib-avoid-updating-frequency-qos-unnecessarily.patch
 cpufreq-intel_pstate-drop-acpi-_pss-states-table-patching.patch
 selftests-mptcp-sockopt-use-iptables-legacy-if-available.patch
+io_uring-treat-eagain-for-req_f_nowait-as-final-for-io-wq.patch