[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 10/13] block: Fix AioContext switch for drained n
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH v2 10/13] block: Fix AioContext switch for drained node |
Date: |
Wed, 20 Feb 2019 18:48:40 +0100 |
When a drained node changes its AioContext, we need to move its
aio_disable_external() to the new context, too.
Without this fix, drain_end will try to reenable the new context, which
has never been disabled, so an assertion failure is triggered.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
block.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/block.c b/block.c
index 17bc1d3dca..aefb5701f5 100644
--- a/block.c
+++ b/block.c
@@ -5227,6 +5227,9 @@ void bdrv_detach_aio_context(BlockDriverState *bs)
bdrv_detach_aio_context(child->bs);
}
+ if (bs->quiesce_counter) {
+ aio_enable_external(bs->aio_context);
+ }
bs->aio_context = NULL;
}
@@ -5240,6 +5243,10 @@ void bdrv_attach_aio_context(BlockDriverState *bs,
return;
}
+ if (bs->quiesce_counter) {
+ aio_disable_external(new_context);
+ }
+
bs->aio_context = new_context;
QLIST_FOREACH(child, &bs->children, next) {
--
2.20.1
- [Qemu-devel] [PATCH v2 05/13] io: Remove redundant read/write_coroutine assignments, (continued)
[Qemu-devel] [PATCH v2 04/13] io: Make qio_channel_yield() interruptible, Kevin Wolf, 2019/02/20
[Qemu-devel] [PATCH v2 06/13] nbd: Move nbd_read_eof() to nbd/client.c, Kevin Wolf, 2019/02/20
[Qemu-devel] [PATCH v2 09/13] block: Don't poll in bdrv_set_aio_context(), Kevin Wolf, 2019/02/20
[Qemu-devel] [PATCH v2 07/13] nbd: Use low-level QIOChannel API in nbd_read_eof(), Kevin Wolf, 2019/02/20
[Qemu-devel] [PATCH v2 08/13] nbd: Increase bs->in_flight during AioContext switch, Kevin Wolf, 2019/02/20
[Qemu-devel] [PATCH v2 10/13] block: Fix AioContext switch for drained node,
Kevin Wolf <=
[Qemu-devel] [PATCH v2 11/13] test-bdrv-drain: AioContext switch in drained section, Kevin Wolf, 2019/02/20
[Qemu-devel] [PATCH v2 12/13] block: Use normal drain for bdrv_set_aio_context(), Kevin Wolf, 2019/02/20
[Qemu-devel] [PATCH v2 13/13] aio-posix: Assert that aio_poll() is always called in home thread, Kevin Wolf, 2019/02/20
Re: [Qemu-devel] [PATCH v2 00/13] block: bdrv_set_aio_context() related fixes, Kevin Wolf, 2019/02/25