From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqp15-0005ng-0C for qemu-devel@nongnu.org; Thu, 14 Apr 2016 17:41:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqp10-00034w-Q9 for qemu-devel@nongnu.org; Thu, 14 Apr 2016 17:41:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqp10-00034l-Hw for qemu-devel@nongnu.org; Thu, 14 Apr 2016 17:41:30 -0400 References: <1460629215-11567-1-git-send-email-den@openvz.org> From: Max Reitz Message-ID: <57100E86.2030408@redhat.com> Date: Thu, 14 Apr 2016 23:41:26 +0200 MIME-Version: 1.0 In-Reply-To: <1460629215-11567-1-git-send-email-den@openvz.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="g3d3lPPT7djUUPRAH4R3DrKmd53B1UAG4" Subject: Re: [Qemu-devel] [PATCH for 2.6 1/1] nbd: fix assert() on qemu-nbd stop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" , qemu-devel@nongnu.org Cc: Paolo Bonzini , Pavel Butsykin This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --g3d3lPPT7djUUPRAH4R3DrKmd53B1UAG4 Content-Type: multipart/mixed; boundary="FbcG06spLgBTmRovoCE1wqKv3j5XhcDKX" From: Max Reitz To: "Denis V. Lunev" , qemu-devel@nongnu.org Cc: Paolo Bonzini , Pavel Butsykin Message-ID: <57100E86.2030408@redhat.com> Subject: Re: [Qemu-devel] [PATCH for 2.6 1/1] nbd: fix assert() on qemu-nbd stop References: <1460629215-11567-1-git-send-email-den@openvz.org> In-Reply-To: <1460629215-11567-1-git-send-email-den@openvz.org> --FbcG06spLgBTmRovoCE1wqKv3j5XhcDKX Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 14.04.2016 12:20, Denis V. Lunev wrote: > From: Pavel Butsykin >=20 > From time to time qemu-nbd is crashing on the following assert: > assert(state =3D=3D TERMINATING); > nbd_export_closed > nbd_export_put > main > and the state at the moment of the crash is evaluated to TERMINATE. >=20 > During shutdown process of the client the nbd_client_thread thread send= s > SIGTERM signal and the main thread calls the nbd_client_closed callback= =2E > If the SIGTERM callback will be executed after change the state to > TERMINATING, then the state will once again be TERMINATE. >=20 > To solve the issue, we must change the state to TERMINATE only if the s= tate > is RUNNING. In the other case we are shutting down already. >=20 > Signed-off-by: Pavel Butsykin > Signed-off-by: Denis V. Lunev > CC: Paolo Bonzini > --- > qemu-nbd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Thanks Pavel and Denis, I have applied the patch to my block tree: https://github.com/XanClic/qemu/commits/block Max --FbcG06spLgBTmRovoCE1wqKv3j5XhcDKX-- --g3d3lPPT7djUUPRAH4R3DrKmd53B1UAG4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXEA6GAAoJEDuxQgLoOKytnxcH/3zB0dguN0G1Dk6Dn/qubCF+ 8WGD0yk1t+a5Nk8DIHbaOMlqZ1MF0JNR3nxTvLD+OZLJnng7YbFJFzkd6KXdi3TG O/kptpfjKvcyjAyeOTHO2m9jOyII9rzz1CrQDcGVmjamFFYnRmItx6Hh3H8s/D0u oj9yU5qJzcUt9ShOi0+delEyRK4NBbxvc+4NnxsmgejcPnQUVZ/ioN1Y4BwQD5j0 nLv8quPnj4R7EsDuZWxm+26NFRCnUvrU654keJX2F0W9thTcXE221dJ3P1karvNJ KybZ5tLI2nNXnn2jrbrHIzaedyErAme8p2KlorFNYv5MChxWyBK+yUyBqmSjTJw= =BT9R -----END PGP SIGNATURE----- --g3d3lPPT7djUUPRAH4R3DrKmd53B1UAG4--