aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/block-backend.c2
-rw-r--r--block/io.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/block/block-backend.c b/block/block-backend.c
index fdb1e1d5f7..3661a066b3 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -2328,6 +2328,7 @@ void coroutine_fn blk_co_io_plug(BlockBackend *blk)
{
BlockDriverState *bs = blk_bs(blk);
IO_CODE();
+ GRAPH_RDLOCK_GUARD();
if (bs) {
bdrv_co_io_plug(bs);
@@ -2338,6 +2339,7 @@ void coroutine_fn blk_co_io_unplug(BlockBackend *blk)
{
BlockDriverState *bs = blk_bs(blk);
IO_CODE();
+ GRAPH_RDLOCK_GUARD();
if (bs) {
bdrv_co_io_unplug(bs);
diff --git a/block/io.c b/block/io.c
index d9c1594960..b5459c2f41 100644
--- a/block/io.c
+++ b/block/io.c
@@ -3153,6 +3153,7 @@ void coroutine_fn bdrv_co_io_plug(BlockDriverState *bs)
{
BdrvChild *child;
IO_CODE();
+ assert_bdrv_graph_readable();
QLIST_FOREACH(child, &bs->children, next) {
bdrv_co_io_plug(child->bs);
@@ -3170,6 +3171,7 @@ void coroutine_fn bdrv_co_io_unplug(BlockDriverState *bs)
{
BdrvChild *child;
IO_CODE();
+ assert_bdrv_graph_readable();
assert(bs->io_plugged);
if (qatomic_fetch_dec(&bs->io_plugged) == 1) {