aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-07-30 09:14:56 +0100
committerPeter Maydell <peter.maydell@linaro.org>2021-07-30 09:14:56 +0100
commitdbdc621be937d9efe3e4dff994e54e8eea051f7a (patch)
tree5fd9403d11229f0979fb18aca067c35a2c1e3ecc
parent7742fe64e5c2c2c9f9787d107b693eaac602eaae (diff)
parentcc8eecd7f105a1dff5876adeb238a14696061a4a (diff)
Merge remote-tracking branch 'remotes/stefanha-gitlab/tags/block-pull-request' into staging
Pull request The main fix here is for io_uring. Spurious -EAGAIN errors can happen and the request needs to be resubmitted. The MAINTAINERS changes carry no risk and we might as well include them in QEMU 6.1. # gpg: Signature made Thu 29 Jul 2021 17:22:20 BST # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha-gitlab/tags/block-pull-request: MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver block/io_uring: resubmit when result is -EAGAIN MAINTAINERS: add Stefano Garzarella as io_uring reviewer Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--MAINTAINERS2
-rw-r--r--block/io_uring.c16
2 files changed, 17 insertions, 1 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 2089e71007..6831978d2c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3177,6 +3177,7 @@ F: block/null.c
NVMe Block Driver
M: Stefan Hajnoczi <stefanha@redhat.com>
R: Fam Zheng <fam@euphon.net>
+R: Philippe Mathieu-Daudé <philmd@redhat.com>
L: qemu-block@nongnu.org
S: Supported
F: block/nvme*
@@ -3256,6 +3257,7 @@ Linux io_uring
M: Aarushi Mehta <mehta.aaru20@gmail.com>
M: Julia Suvorova <jusual@redhat.com>
M: Stefan Hajnoczi <stefanha@redhat.com>
+R: Stefano Garzarella <sgarzare@redhat.com>
L: qemu-block@nongnu.org
S: Maintained
F: block/io_uring.c
diff --git a/block/io_uring.c b/block/io_uring.c
index 00a3ee9fb8..dfa475cc87 100644
--- a/block/io_uring.c
+++ b/block/io_uring.c
@@ -165,7 +165,21 @@ static void luring_process_completions(LuringState *s)
total_bytes = ret + luringcb->total_read;
if (ret < 0) {
- if (ret == -EINTR) {
+ /*
+ * Only writev/readv/fsync requests on regular files or host block
+ * devices are submitted. Therefore -EAGAIN is not expected but it's
+ * known to happen sometimes with Linux SCSI. Submit again and hope
+ * the request completes successfully.
+ *
+ * For more information, see:
+ * https://lore.kernel.org/io-uring/20210727165811.284510-3-axboe@kernel.dk/T/#u
+ *
+ * If the code is changed to submit other types of requests in the
+ * future, then this workaround may need to be extended to deal with
+ * genuine -EAGAIN results that should not be resubmitted
+ * immediately.
+ */
+ if (ret == -EINTR || ret == -EAGAIN) {
luring_resubmit(s, luringcb);
continue;
}