aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2017-02-09 12:46:27 +0100
committerKevin Wolf <kwolf@redhat.com>2017-02-28 20:40:37 +0100
commitdd65a52e4aa4a0adfedf0ed9a35da1960f359fe1 (patch)
tree1cc07eaca633931941cc5b8f7c7de15ad328ad81 /block.c
parent4e9e4323d5ec07a07f8db9317e1842a5e00a14e2 (diff)
block: Fix pending requests check in bdrv_append()
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>
Diffstat (limited to 'block.c')
-rw-r--r--block.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block.c b/block.c
index 9e538a5d41..5189c7c55c 100644
--- 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);