From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M4ZI4-0006dz-Oy for qemu-devel@nongnu.org; Thu, 14 May 2009 07:39:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M4ZHz-0006cB-N7 for qemu-devel@nongnu.org; Thu, 14 May 2009 07:39:56 -0400 Received: from [199.232.76.173] (port=37101 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M4ZHy-0006bn-Lp for qemu-devel@nongnu.org; Thu, 14 May 2009 07:39:50 -0400 Received: from mx2.redhat.com ([66.187.237.31]:47159) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M4ZHy-0007F2-50 for qemu-devel@nongnu.org; Thu, 14 May 2009 07:39:50 -0400 Subject: Re: [Qemu-devel] [STABLE][PATCH 3/4] Fix vectored aio bounce handling immediate errors From: Mark McLoughlin In-Reply-To: <1242298581-30587-4-git-send-email-markmc@redhat.com> References: <1240265600-9469-1-git-send-email-ryanh@us.ibm.com> <1242298581-30587-1-git-send-email-markmc@redhat.com> <1242298581-30587-2-git-send-email-markmc@redhat.com> <1242298581-30587-3-git-send-email-markmc@redhat.com> <1242298581-30587-4-git-send-email-markmc@redhat.com> Content-Type: text/plain Date: Thu, 14 May 2009 12:39:44 +0100 Message-Id: <1242301184.32336.1.camel@blaa> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: Mark McLoughlin List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, Avi Kivity On Thu, 2009-05-14 at 11:56 +0100, Mark McLoughlin wrote: > From: Avi Kivity > > If a bounced vectored aio fails immediately (the inner aio submission > returning NULL) then the bounce handler erronously returns an aio > request which will never be completed (and which crashes when cancelled). > > Fix by detecting that the inner request has failed and propagating the > error. > > Signed-off-by: Avi Kivity Signed-off-by: Mark McLoughlin > --- > block.c | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/block.c b/block.c > index 689ea37..b68a8da 100644 > --- a/block.c > +++ b/block.c > @@ -1383,6 +1383,11 @@ static BlockDriverAIOCB *bdrv_aio_rw_vector(BlockDriverState *bs, > s->aiocb = bdrv_aio_read(bs, sector_num, s->bounce, nb_sectors, > bdrv_aio_rw_vector_cb, s); > } > + if (!s->aiocb) { > + qemu_vfree(s->bounce); > + qemu_aio_release(s); > + return NULL; > + } > return &s->common; > } >