]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block: Fix pending requests check in bdrv_append()
authorKevin Wolf <kwolf@redhat.com>
Thu, 9 Feb 2017 11:46:27 +0000 (12:46 +0100)
committerKevin Wolf <kwolf@redhat.com>
Tue, 28 Feb 2017 19:40:37 +0000 (20:40 +0100)
bdrv_append() cares about isolation of the node that it modifies, but
not about activity in some subtree below it. Instead of using the
recursive bdrv_requests_pending(), directly check bs->in_flight, which
considers only the node in question.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Acked-by: Fam Zheng <famz@redhat.com>
block.c

diff --git a/block.c b/block.c
index 9e538a5d4101b3e611f80d87cfdab122788e4a5c..5189c7c55ca2cded87c11d623a35bd348fd643d3 100644 (file)
--- a/block.c
+++ b/block.c
@@ -2897,8 +2897,8 @@ static void change_parent_backing_link(BlockDriverState *from,
  */
 void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top)
 {
-    assert(!bdrv_requests_pending(bs_top));
-    assert(!bdrv_requests_pending(bs_new));
+    assert(!atomic_read(&bs_top->in_flight));
+    assert(!atomic_read(&bs_new->in_flight));
 
     bdrv_ref(bs_top);