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 R: Fam Zheng +R: Philippe Mathieu-Daudé L: qemu-block@nongnu.org S: Supported F: block/nvme* @@ -3256,6 +3257,7 @@ Linux io_uring M: Aarushi Mehta M: Julia Suvorova M: Stefan Hajnoczi +R: Stefano Garzarella 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; }