1
The following changes since commit bb9bf94b3e8926553290bc9a7cb84315af422086:
1
The following changes since commit 3521ade3510eb5cefb2e27a101667f25dad89935:
2
2
3
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging (2018-12-11 19:18:58 +0000)
3
Merge remote-tracking branch 'remotes/thuth-gitlab/tags/pull-request-2021-07-29' into staging (2021-07-29 13:17:20 +0100)
4
4
5
are available in the Git repository at:
5
are available in the Git repository at:
6
6
7
git://github.com/stefanha/qemu.git tags/block-pull-request
7
https://gitlab.com/stefanha/qemu.git tags/block-pull-request
8
8
9
for you to fetch changes up to e61809ed8ac3a2f68eb1cc231244f84eb06adacf:
9
for you to fetch changes up to cc8eecd7f105a1dff5876adeb238a14696061a4a:
10
10
11
virtio-blk: fix comment for virtio_blk_rw_complete as nalloc is initially -1 (2018-12-12 09:16:55 +0000)
11
MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver (2021-07-29 17:17:34 +0100)
12
12
13
----------------------------------------------------------------
13
----------------------------------------------------------------
14
Pull request
14
Pull request
15
15
16
Minor virtio-blk fixes.
16
The main fix here is for io_uring. Spurious -EAGAIN errors can happen and the
17
request needs to be resubmitted.
18
19
The MAINTAINERS changes carry no risk and we might as well include them in QEMU
20
6.1.
17
21
18
----------------------------------------------------------------
22
----------------------------------------------------------------
19
23
20
Dongli Zhang (2):
24
Fabian Ebner (1):
21
virtio-blk: rename iov to out_iov in virtio_blk_handle_request()
25
block/io_uring: resubmit when result is -EAGAIN
22
virtio-blk: fix comment for virtio_blk_rw_complete as nalloc is
23
initially -1
24
26
25
hw/block/virtio-blk.c | 10 +++++-----
27
Philippe Mathieu-Daudé (1):
26
1 file changed, 5 insertions(+), 5 deletions(-)
28
MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver
29
30
Stefano Garzarella (1):
31
MAINTAINERS: add Stefano Garzarella as io_uring reviewer
32
33
MAINTAINERS | 2 ++
34
block/io_uring.c | 16 +++++++++++++++-
35
2 files changed, 17 insertions(+), 1 deletion(-)
27
36
28
--
37
--
29
2.19.2
38
2.31.1
30
39
31
diff view generated by jsdifflib
New patch
1
From: Stefano Garzarella <sgarzare@redhat.com>
1
2
3
I've been working with io_uring for a while so I'd like to help
4
with reviews.
5
6
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
7
Message-Id: <20210728131515.131045-1-sgarzare@redhat.com>
8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9
---
10
MAINTAINERS | 1 +
11
1 file changed, 1 insertion(+)
12
13
diff --git a/MAINTAINERS b/MAINTAINERS
14
index XXXXXXX..XXXXXXX 100644
15
--- a/MAINTAINERS
16
+++ b/MAINTAINERS
17
@@ -XXX,XX +XXX,XX @@ Linux io_uring
18
M: Aarushi Mehta <mehta.aaru20@gmail.com>
19
M: Julia Suvorova <jusual@redhat.com>
20
M: Stefan Hajnoczi <stefanha@redhat.com>
21
+R: Stefano Garzarella <sgarzare@redhat.com>
22
L: qemu-block@nongnu.org
23
S: Maintained
24
F: block/io_uring.c
25
--
26
2.31.1
27
diff view generated by jsdifflib
1
From: Dongli Zhang <dongli.zhang@oracle.com>
1
From: Fabian Ebner <f.ebner@proxmox.com>
2
2
3
The initial value of nalloc is -1, but not 1.
3
Linux SCSI can throw spurious -EAGAIN in some corner cases in its
4
completion path, which will end up being the result in the completed
5
io_uring request.
4
6
5
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
7
Resubmitting such requests should allow block jobs to complete, even
6
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
8
if such spurious errors are encountered.
7
Message-id: 1541479952-32355-1-git-send-email-dongli.zhang@oracle.com
9
10
Co-authored-by: Stefan Hajnoczi <stefanha@gmail.com>
11
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
12
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
13
Message-id: 20210729091029.65369-1-f.ebner@proxmox.com
8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
14
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9
---
15
---
10
hw/block/virtio-blk.c | 2 +-
16
block/io_uring.c | 16 +++++++++++++++-
11
1 file changed, 1 insertion(+), 1 deletion(-)
17
1 file changed, 15 insertions(+), 1 deletion(-)
12
18
13
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
19
diff --git a/block/io_uring.c b/block/io_uring.c
14
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
15
--- a/hw/block/virtio-blk.c
21
--- a/block/io_uring.c
16
+++ b/hw/block/virtio-blk.c
22
+++ b/block/io_uring.c
17
@@ -XXX,XX +XXX,XX @@ static void virtio_blk_rw_complete(void *opaque, int ret)
23
@@ -XXX,XX +XXX,XX @@ static void luring_process_completions(LuringState *s)
18
trace_virtio_blk_rw_complete(vdev, req, ret);
24
total_bytes = ret + luringcb->total_read;
19
25
20
if (req->qiov.nalloc != -1) {
26
if (ret < 0) {
21
- /* If nalloc is != 1 req->qiov is a local copy of the original
27
- if (ret == -EINTR) {
22
+ /* If nalloc is != -1 req->qiov is a local copy of the original
28
+ /*
23
* external iovec. It was allocated in submit_requests to be
29
+ * Only writev/readv/fsync requests on regular files or host block
24
* able to merge requests. */
30
+ * devices are submitted. Therefore -EAGAIN is not expected but it's
25
qemu_iovec_destroy(&req->qiov);
31
+ * known to happen sometimes with Linux SCSI. Submit again and hope
32
+ * the request completes successfully.
33
+ *
34
+ * For more information, see:
35
+ * https://lore.kernel.org/io-uring/20210727165811.284510-3-axboe@kernel.dk/T/#u
36
+ *
37
+ * If the code is changed to submit other types of requests in the
38
+ * future, then this workaround may need to be extended to deal with
39
+ * genuine -EAGAIN results that should not be resubmitted
40
+ * immediately.
41
+ */
42
+ if (ret == -EINTR || ret == -EAGAIN) {
43
luring_resubmit(s, luringcb);
44
continue;
45
}
26
--
46
--
27
2.19.2
47
2.31.1
28
48
29
diff view generated by jsdifflib
1
From: Dongli Zhang <dongli.zhang@oracle.com>
1
From: Philippe Mathieu-Daudé <philmd@redhat.com>
2
2
3
In virtio_blk_handle_request(), in_iov is used for input header while iov
3
I'm interested in following the activity around the NVMe bdrv.
4
is used for output header. Rename iov to out_iov to pair output header's
5
name with in_iov to avoid confusing people when reading source code.
6
4
7
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
5
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
8
Message-id: 1541520556-8334-1-git-send-email-dongli.zhang@oracle.com
6
Message-id: 20210728183340.2018313-1-philmd@redhat.com
9
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10
---
8
---
11
hw/block/virtio-blk.c | 8 ++++----
9
MAINTAINERS | 1 +
12
1 file changed, 4 insertions(+), 4 deletions(-)
10
1 file changed, 1 insertion(+)
13
11
14
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
12
diff --git a/MAINTAINERS b/MAINTAINERS
15
index XXXXXXX..XXXXXXX 100644
13
index XXXXXXX..XXXXXXX 100644
16
--- a/hw/block/virtio-blk.c
14
--- a/MAINTAINERS
17
+++ b/hw/block/virtio-blk.c
15
+++ b/MAINTAINERS
18
@@ -XXX,XX +XXX,XX @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
16
@@ -XXX,XX +XXX,XX @@ F: block/null.c
19
{
17
NVMe Block Driver
20
uint32_t type;
18
M: Stefan Hajnoczi <stefanha@redhat.com>
21
struct iovec *in_iov = req->elem.in_sg;
19
R: Fam Zheng <fam@euphon.net>
22
- struct iovec *iov = req->elem.out_sg;
20
+R: Philippe Mathieu-Daudé <philmd@redhat.com>
23
+ struct iovec *out_iov = req->elem.out_sg;
21
L: qemu-block@nongnu.org
24
unsigned in_num = req->elem.in_num;
22
S: Supported
25
unsigned out_num = req->elem.out_num;
23
F: block/nvme*
26
VirtIOBlock *s = req->dev;
27
@@ -XXX,XX +XXX,XX @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
28
return -1;
29
}
30
31
- if (unlikely(iov_to_buf(iov, out_num, 0, &req->out,
32
+ if (unlikely(iov_to_buf(out_iov, out_num, 0, &req->out,
33
sizeof(req->out)) != sizeof(req->out))) {
34
virtio_error(vdev, "virtio-blk request outhdr too short");
35
return -1;
36
}
37
38
- iov_discard_front(&iov, &out_num, sizeof(req->out));
39
+ iov_discard_front(&out_iov, &out_num, sizeof(req->out));
40
41
if (in_iov[in_num - 1].iov_len < sizeof(struct virtio_blk_inhdr)) {
42
virtio_error(vdev, "virtio-blk request inhdr too short");
43
@@ -XXX,XX +XXX,XX @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
44
&req->out.sector);
45
46
if (is_write) {
47
- qemu_iovec_init_external(&req->qiov, iov, out_num);
48
+ qemu_iovec_init_external(&req->qiov, out_iov, out_num);
49
trace_virtio_blk_handle_write(vdev, req, req->sector_num,
50
req->qiov.size / BDRV_SECTOR_SIZE);
51
} else {
52
--
24
--
53
2.19.2
25
2.31.1
54
26
55
diff view generated by jsdifflib