1 | The following changes since commit b38df311c174c98ef8cce7dec9f46603b083018e: | 1 | The following changes since commit 3521ade3510eb5cefb2e27a101667f25dad89935: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.10-20170809' into staging (2017-08-10 11:12:36 +0100) | 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 17d0bc01bfcce0ad4fb5105d4502595224569ff0: | 9 | for you to fetch changes up to cc8eecd7f105a1dff5876adeb238a14696061a4a: |
10 | 10 | ||
11 | virtio-blk: handle blk_getlength() errors (2017-08-10 14:33:43 +0100) | 11 | MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver (2021-07-29 17:17:34 +0100) |
12 | |||
13 | ---------------------------------------------------------------- | ||
14 | Pull request | ||
15 | |||
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. | ||
12 | 21 | ||
13 | ---------------------------------------------------------------- | 22 | ---------------------------------------------------------------- |
14 | 23 | ||
15 | ---------------------------------------------------------------- | 24 | Fabian Ebner (1): |
25 | block/io_uring: resubmit when result is -EAGAIN | ||
16 | 26 | ||
17 | Kevin Wolf (1): | 27 | Philippe Mathieu-Daudé (1): |
18 | IDE: test flush on empty CDROM | 28 | MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver |
19 | 29 | ||
20 | Stefan Hajnoczi (2): | 30 | Stefano Garzarella (1): |
21 | IDE: Do not flush empty CDROM drives | 31 | MAINTAINERS: add Stefano Garzarella as io_uring reviewer |
22 | virtio-blk: handle blk_getlength() errors | ||
23 | 32 | ||
24 | hw/block/virtio-blk.c | 4 +++- | 33 | MAINTAINERS | 2 ++ |
25 | hw/ide/core.c | 10 +++++++++- | 34 | block/io_uring.c | 16 +++++++++++++++- |
26 | tests/ide-test.c | 19 +++++++++++++++++++ | 35 | 2 files changed, 17 insertions(+), 1 deletion(-) |
27 | 3 files changed, 31 insertions(+), 2 deletions(-) | ||
28 | 36 | ||
29 | -- | 37 | -- |
30 | 2.13.4 | 38 | 2.31.1 |
31 | 39 | ||
32 | diff view generated by jsdifflib |
1 | If blk_getlength() fails in virtio_blk_update_config() consider the disk | 1 | From: Stefano Garzarella <sgarzare@redhat.com> |
---|---|---|---|
2 | image length to be 0 bytes. | ||
3 | 2 | ||
4 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 3 | I've been working with io_uring for a while so I'd like to help |
5 | Reviewed-by: Fam Zheng <famz@redhat.com> | 4 | with reviews. |
6 | Message-id: 20170808122251.29815-1-stefanha@redhat.com | 5 | |
6 | Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> | ||
7 | Message-Id: <20210728131515.131045-1-sgarzare@redhat.com> | ||
7 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 8 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
8 | --- | 9 | --- |
9 | hw/block/virtio-blk.c | 4 +++- | 10 | MAINTAINERS | 1 + |
10 | 1 file changed, 3 insertions(+), 1 deletion(-) | 11 | 1 file changed, 1 insertion(+) |
11 | 12 | ||
12 | diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c | 13 | diff --git a/MAINTAINERS b/MAINTAINERS |
13 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/hw/block/virtio-blk.c | 15 | --- a/MAINTAINERS |
15 | +++ b/hw/block/virtio-blk.c | 16 | +++ b/MAINTAINERS |
16 | @@ -XXX,XX +XXX,XX @@ static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config) | 17 | @@ -XXX,XX +XXX,XX @@ Linux io_uring |
17 | BlockConf *conf = &s->conf.conf; | 18 | M: Aarushi Mehta <mehta.aaru20@gmail.com> |
18 | struct virtio_blk_config blkcfg; | 19 | M: Julia Suvorova <jusual@redhat.com> |
19 | uint64_t capacity; | 20 | M: Stefan Hajnoczi <stefanha@redhat.com> |
20 | + int64_t length; | 21 | +R: Stefano Garzarella <sgarzare@redhat.com> |
21 | int blk_size = conf->logical_block_size; | 22 | L: qemu-block@nongnu.org |
22 | 23 | S: Maintained | |
23 | blk_get_geometry(s->blk, &capacity); | 24 | F: block/io_uring.c |
24 | @@ -XXX,XX +XXX,XX @@ static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config) | ||
25 | * divided by 512 - instead it is the amount of blk_size blocks | ||
26 | * per track (cylinder). | ||
27 | */ | ||
28 | - if (blk_getlength(s->blk) / conf->heads / conf->secs % blk_size) { | ||
29 | + length = blk_getlength(s->blk); | ||
30 | + if (length > 0 && length / conf->heads / conf->secs % blk_size) { | ||
31 | blkcfg.geometry.sectors = conf->secs & ~s->sector_mask; | ||
32 | } else { | ||
33 | blkcfg.geometry.sectors = conf->secs; | ||
34 | -- | 25 | -- |
35 | 2.13.4 | 26 | 2.31.1 |
36 | 27 | ||
37 | diff view generated by jsdifflib |
1 | From: Kevin Wolf <kwolf@redhat.com> | 1 | From: Fabian Ebner <f.ebner@proxmox.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Kevin Wolf <kwolf@redhat.com> | 3 | Linux SCSI can throw spurious -EAGAIN in some corner cases in its |
4 | Signed-off-by: John Snow <jsnow@redhat.com> | 4 | completion path, which will end up being the result in the completed |
5 | Reviewed-by: Eric Blake <eblake@redhat.com> | 5 | io_uring request. |
6 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 6 | |
7 | Message-id: 20170809160212.29976-3-stefanha@redhat.com | 7 | Resubmitting such requests should allow block jobs to complete, even |
8 | if such spurious errors are encountered. | ||
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 | tests/ide-test.c | 19 +++++++++++++++++++ | 16 | block/io_uring.c | 16 +++++++++++++++- |
11 | 1 file changed, 19 insertions(+) | 17 | 1 file changed, 15 insertions(+), 1 deletion(-) |
12 | 18 | ||
13 | diff --git a/tests/ide-test.c b/tests/ide-test.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/tests/ide-test.c | 21 | --- a/block/io_uring.c |
16 | +++ b/tests/ide-test.c | 22 | +++ b/block/io_uring.c |
17 | @@ -XXX,XX +XXX,XX @@ static void test_flush_nodev(void) | 23 | @@ -XXX,XX +XXX,XX @@ static void luring_process_completions(LuringState *s) |
18 | ide_test_quit(); | 24 | total_bytes = ret + luringcb->total_read; |
19 | } | 25 | |
20 | 26 | if (ret < 0) { | |
21 | +static void test_flush_empty_drive(void) | 27 | - if (ret == -EINTR) { |
22 | +{ | 28 | + /* |
23 | + QPCIDevice *dev; | 29 | + * Only writev/readv/fsync requests on regular files or host block |
24 | + QPCIBar bmdma_bar, ide_bar; | 30 | + * devices are submitted. Therefore -EAGAIN is not expected but it's |
25 | + | 31 | + * known to happen sometimes with Linux SCSI. Submit again and hope |
26 | + ide_test_start("-device ide-cd,bus=ide.0"); | 32 | + * the request completes successfully. |
27 | + dev = get_pci_device(&bmdma_bar, &ide_bar); | 33 | + * |
28 | + | 34 | + * For more information, see: |
29 | + /* FLUSH CACHE command on device 0 */ | 35 | + * https://lore.kernel.org/io-uring/20210727165811.284510-3-axboe@kernel.dk/T/#u |
30 | + qpci_io_writeb(dev, ide_bar, reg_device, 0); | 36 | + * |
31 | + qpci_io_writeb(dev, ide_bar, reg_command, CMD_FLUSH_CACHE); | 37 | + * If the code is changed to submit other types of requests in the |
32 | + | 38 | + * future, then this workaround may need to be extended to deal with |
33 | + /* Just testing that qemu doesn't crash... */ | 39 | + * genuine -EAGAIN results that should not be resubmitted |
34 | + | 40 | + * immediately. |
35 | + free_pci_device(dev); | 41 | + */ |
36 | + ide_test_quit(); | 42 | + if (ret == -EINTR || ret == -EAGAIN) { |
37 | +} | 43 | luring_resubmit(s, luringcb); |
38 | + | 44 | continue; |
39 | static void test_pci_retry_flush(void) | 45 | } |
40 | { | ||
41 | test_retry_flush("pc"); | ||
42 | @@ -XXX,XX +XXX,XX @@ int main(int argc, char **argv) | ||
43 | |||
44 | qtest_add_func("/ide/flush", test_flush); | ||
45 | qtest_add_func("/ide/flush/nodev", test_flush_nodev); | ||
46 | + qtest_add_func("/ide/flush/empty_drive", test_flush_empty_drive); | ||
47 | qtest_add_func("/ide/flush/retry_pci", test_pci_retry_flush); | ||
48 | qtest_add_func("/ide/flush/retry_isa", test_isa_retry_flush); | ||
49 | |||
50 | -- | 46 | -- |
51 | 2.13.4 | 47 | 2.31.1 |
52 | 48 | ||
53 | diff view generated by jsdifflib |
1 | The block backend changed in a way that flushing empty CDROM drives now | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | crashes. Amend IDE to avoid doing so until the root problem can be | ||
3 | addressed for 2.11. | ||
4 | 2 | ||
5 | Original patch by John Snow <jsnow@redhat.com>. | 3 | I'm interested in following the activity around the NVMe bdrv. |
6 | 4 | ||
7 | Reported-by: Kieron Shorrock <kshorrock@paloaltonetworks.com> | 5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
8 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 6 | Message-id: 20210728183340.2018313-1-philmd@redhat.com |
9 | Reviewed-by: Eric Blake <eblake@redhat.com> | ||
10 | Message-id: 20170809160212.29976-2-stefanha@redhat.com | ||
11 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 7 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
12 | --- | 8 | --- |
13 | hw/ide/core.c | 10 +++++++++- | 9 | MAINTAINERS | 1 + |
14 | 1 file changed, 9 insertions(+), 1 deletion(-) | 10 | 1 file changed, 1 insertion(+) |
15 | 11 | ||
16 | diff --git a/hw/ide/core.c b/hw/ide/core.c | 12 | diff --git a/MAINTAINERS b/MAINTAINERS |
17 | index XXXXXXX..XXXXXXX 100644 | 13 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/hw/ide/core.c | 14 | --- a/MAINTAINERS |
19 | +++ b/hw/ide/core.c | 15 | +++ b/MAINTAINERS |
20 | @@ -XXX,XX +XXX,XX @@ static void ide_flush_cache(IDEState *s) | 16 | @@ -XXX,XX +XXX,XX @@ F: block/null.c |
21 | s->status |= BUSY_STAT; | 17 | NVMe Block Driver |
22 | ide_set_retry(s); | 18 | M: Stefan Hajnoczi <stefanha@redhat.com> |
23 | block_acct_start(blk_get_stats(s->blk), &s->acct, 0, BLOCK_ACCT_FLUSH); | 19 | R: Fam Zheng <fam@euphon.net> |
24 | - s->pio_aiocb = blk_aio_flush(s->blk, ide_flush_cb, s); | 20 | +R: Philippe Mathieu-Daudé <philmd@redhat.com> |
25 | + | 21 | L: qemu-block@nongnu.org |
26 | + if (blk_bs(s->blk)) { | 22 | S: Supported |
27 | + s->pio_aiocb = blk_aio_flush(s->blk, ide_flush_cb, s); | 23 | F: block/nvme* |
28 | + } else { | ||
29 | + /* XXX blk_aio_flush() crashes when blk_bs(blk) is NULL, remove this | ||
30 | + * temporary workaround when blk_aio_*() functions handle NULL blk_bs. | ||
31 | + */ | ||
32 | + ide_flush_cb(s, 0); | ||
33 | + } | ||
34 | } | ||
35 | |||
36 | static void ide_cfata_metadata_inquiry(IDEState *s) | ||
37 | -- | 24 | -- |
38 | 2.13.4 | 25 | 2.31.1 |
39 | 26 | ||
40 | diff view generated by jsdifflib |