[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PATCH v2 28/43] block: Fix pending requests check in bdrv_

From: Kevin Wolf
Subject: [Qemu-block] [PATCH v2 28/43] block: Fix pending requests check in bdrv_append()
Date: Mon, 27 Feb 2017 21:09:29 +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 <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
 block.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block.c b/block.c
index 6456917..7926c6c 100644
--- a/block.c
+++ b/block.c
@@ -2886,8 +2886,8 @@ static void change_parent_backing_link(BlockDriverState 
 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));

reply via email to

[Prev in Thread] Current Thread [Next in Thread]