From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XON66-0006vQ-H1 for qemu-devel@nongnu.org; Mon, 01 Sep 2014 04:36:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XON5y-00036u-JT for qemu-devel@nongnu.org; Mon, 01 Sep 2014 04:36:22 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:36494 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XON5y-00036l-E6 for qemu-devel@nongnu.org; Mon, 01 Sep 2014 04:36:14 -0400 Date: Mon, 1 Sep 2014 10:35:27 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140901083526.GF15537@irqsave.net> References: <1409557394-11853-1-git-send-email-namei.unix@gmail.com> <1409557394-11853-6-git-send-email-namei.unix@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1409557394-11853-6-git-send-email-namei.unix@gmail.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 5/8] quorum: fix quorum_aio_cancel() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Yuan Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi The Monday 01 Sep 2014 =E0 15:43:11 (+0800), Liu Yuan wrote : > For a fifo read pattern, we only have one running aio >(possible other cases that has less number than num_children in the futu= re) I have trouble understanding this part of the commit message could you tr= y to clarify it ? > , so we need to check if > .acb is NULL against bdrv_aio_cancel() to avoid segfault. >=20 > Cc: Eric Blake > Cc: Benoit Canet > Cc: Kevin Wolf > Cc: Stefan Hajnoczi > Signed-off-by: Liu Yuan > --- > block/quorum.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/block/quorum.c b/block/quorum.c > index 9e056d6..b9eeda3 100644 > --- a/block/quorum.c > +++ b/block/quorum.c > @@ -144,7 +144,9 @@ static void quorum_aio_cancel(BlockDriverAIOCB *blo= ckacb) > =20 > /* cancel all callbacks */ > for (i =3D 0; i < s->num_children; i++) { > - bdrv_aio_cancel(acb->qcrs[i].aiocb); > + if (acb->qcrs[i].aiocb) { > + bdrv_aio_cancel(acb->qcrs[i].aiocb); > + } > } > =20 > quorum_aio_release(acb); > --=20 > 1.9.1 >=20