From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRIys-0005P3-CJ for qemu-devel@nongnu.org; Fri, 27 Feb 2015 06:21:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRIyn-0003D4-De for qemu-devel@nongnu.org; Fri, 27 Feb 2015 06:21:18 -0500 Received: from mail-wg0-x236.google.com ([2a00:1450:400c:c00::236]:42221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRIyn-0003Bz-81 for qemu-devel@nongnu.org; Fri, 27 Feb 2015 06:21:13 -0500 Received: by wghl2 with SMTP id l2so19563592wgh.9 for ; Fri, 27 Feb 2015 03:21:12 -0800 (PST) Date: Fri, 27 Feb 2015 11:21:10 +0000 From: Stefan Hajnoczi Message-ID: <20150227112110.GA20354@stefanha-thinkpad.redhat.com> References: <1425024829-1246-1-git-send-email-berto@igalia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Nq2Wo0NMKNjxTN9z" Content-Disposition: inline In-Reply-To: <1425024829-1246-1-git-send-email-berto@igalia.com> Subject: Re: [Qemu-devel] [PATCH] block: Ensure correct order when dropping intermediate images List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 27, 2015 at 10:13:49AM +0200, Alberto Garcia wrote: > Given a chain of images like [A] <- [B] <- [C] <- [D] <- [E], where > [E] is the active (topmost) image, if we want to remove [B] and [C] we > have to do it before linking [A] and [D]. >=20 > When [A] is set as the backing image of [D] all its operations are > blocked, but removing [B] afterwards would undo those changes, since > [B] would still be connected to [A]. >=20 > This would result in a situation where the backing image [A] has all > its operations unblocked. Op blockers are linked to a unique Error object. When B's backing_hd is set to NULL only B->backing_blocker is unblocked but new_top_bs->backing_blocker is still in place. This means operations are still blocked. How do you reproduce this problem? Do you have a test case that can be added to tests/qemu-iotests/? > Signed-off-by: Alberto Garcia > --- > block.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/block.c b/block.c > index 9b707e3..2c36351 100644 > --- a/block.c > +++ b/block.c > @@ -2624,13 +2624,14 @@ int bdrv_drop_intermediate(BlockDriverState *acti= ve, BlockDriverState *top, > if (ret) { > goto exit; > } > - bdrv_set_backing_hd(new_top_bs, base_bs); > + bdrv_set_backing_hd(new_top_bs, NULL); > =20 > QSIMPLEQ_FOREACH_SAFE(intermediate_state, &states_to_delete, entry, = next) { > /* so that bdrv_close() does not recursively close the chain */ > bdrv_set_backing_hd(intermediate_state->bs, NULL); > bdrv_unref(intermediate_state->bs); > } > + bdrv_set_backing_hd(new_top_bs, base_bs); > ret =3D 0; > =20 > exit: > --=20 > 2.1.4 >=20 >=20 --Nq2Wo0NMKNjxTN9z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU8FMmAAoJEJykq7OBq3PIWF0H/RmsG25uoI8cHTBTOYPGWzcG B9UUv/aC5qUq/P1IIyoZJBLFU6TG908vDYuCzud8iN680LvBTWrBdfafOyfpiDz/ 2ehnh0N9UA5WOqnwfn/Ghf1ael6M4PCfKAqwayRLFI0FjZX+4D2Q/lbZ6XXQxZoQ /rtUQR+p7/Lb+mjEqH1nRUFdRvn2PN19z7kvc8mZ12BHNI2MeMcuH+6mh+QpOKij 3cJ2HoJQzqCKccB05NFza+4UZ1yPrvtoA6PE9prQ8ZpRrTMRggeu3n0UJTZhmiTG WLhLMVzK5ySwhgEKZynVksa3DUq4qx28mSEYRKtQPkxd6VarRUSCFCEZFvT9Vtc= =iJjC -----END PGP SIGNATURE----- --Nq2Wo0NMKNjxTN9z--