[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/12] block/io.c: fully enable assert_bdrv_graph_writable
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH 11/12] block/io.c: fully enable assert_bdrv_graph_writable |
Date: |
Tue, 18 Jan 2022 11:27:37 -0500 |
As explained in the TODO, complete the function by checking
that the node is also drained.
In this way, we can ensure that modify the bs is thread safe,
as the drain makes sure that no I/O concurrently reads the field,
and all writes are under BQL.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
block/io.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/block/io.c b/block/io.c
index 9d5167f64a..d7b0707662 100644
--- a/block/io.c
+++ b/block/io.c
@@ -765,12 +765,7 @@ void bdrv_drain_all(void)
void assert_bdrv_graph_writable(BlockDriverState *bs)
{
- /*
- * TODO: this function is incomplete. Because the users of this
- * assert lack the necessary drains, check only for BQL.
- * Once the necessary drains are added,
- * assert also for qatomic_read(&bs->quiesce_counter) > 0
- */
+ assert(qatomic_read(&bs->quiesce_counter) > 0);
assert(qemu_in_main_thread());
}
--
2.31.1
- Re: [PATCH 10/12] block.c: add subtree_drains where needed, (continued)
- [PATCH 12/12] block.c: additional assert qemu in main tread, Emanuele Giuseppe Esposito, 2022/01/18
- [PATCH 06/12] test-bdrv-drain.c: remove test_detach_by_parent_cb(), Emanuele Giuseppe Esposito, 2022/01/18
- [PATCH 03/12] block.c: bdrv_replace_child_noperm: first remove the child, and then call ->detach(), Emanuele Giuseppe Esposito, 2022/01/18
- [PATCH 02/12] block/io.c: make bdrv_do_drained_begin_quiesce static and introduce bdrv_drained_begin_no_poll, Emanuele Giuseppe Esposito, 2022/01/18
- [PATCH 04/12] block.c: bdrv_replace_child_noperm: first call ->attach(), and then add child, Emanuele Giuseppe Esposito, 2022/01/18
- [PATCH 07/12] block/io.c: introduce bdrv_subtree_drained_{begin/end}_unlocked, Emanuele Giuseppe Esposito, 2022/01/18
- [PATCH 11/12] block/io.c: fully enable assert_bdrv_graph_writable,
Emanuele Giuseppe Esposito <=
- Re: [PATCH 00/12] Removal of Aiocontext lock through drains: protect bdrv_replace_child_noperm., Paolo Bonzini, 2022/01/19
- Re: [PATCH 00/12] Removal of Aiocontext lock through drains: protect bdrv_replace_child_noperm., Stefan Hajnoczi, 2022/01/26