From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M4Yc1-0001TG-Ko for qemu-devel@nongnu.org; Thu, 14 May 2009 06:56:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M4Ybx-0001Ro-0v for qemu-devel@nongnu.org; Thu, 14 May 2009 06:56:29 -0400 Received: from [199.232.76.173] (port=52195 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M4Ybw-0001RP-IO for qemu-devel@nongnu.org; Thu, 14 May 2009 06:56:24 -0400 Received: from mail26.svc.cra.dublin.eircom.net ([159.134.118.55]:43218) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1M4Ybw-0000Mf-0Y for qemu-devel@nongnu.org; Thu, 14 May 2009 06:56:24 -0400 From: Mark McLoughlin Date: Thu, 14 May 2009 11:56:20 +0100 Message-Id: <1242298581-30587-4-git-send-email-markmc@redhat.com> In-Reply-To: <1242298581-30587-3-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> Subject: [Qemu-devel] [STABLE][PATCH 3/4] Fix vectored aio bounce handling immediate errors 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 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 --- 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; } -- 1.6.0.6