Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LnC8c-0000xQ-LA for qemu-devel@nongnu.org; Fri, 27 Mar 2009 09:30:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LnC8X-0000ub-Lf for qemu-devel@nongnu.org; Fri, 27 Mar 2009 09:30:21 -0400 Received: from [199.232.76.173] (port=55041 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LnC8X-0000uS-EI for qemu-devel@nongnu.org; Fri, 27 Mar 2009 09:30:17 -0400 Received: from mx2.redhat.com ([66.187.237.31]:43694) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LnC8W-0007MP-SN for qemu-devel@nongnu.org; Fri, 27 Mar 2009 09:30:17 -0400 From: Avi Kivity Date: Fri, 27 Mar 2009 16:30:29 +0300 Message-Id: <1238160630-8745-2-git-send-email-avi@redhat.com> In-Reply-To: <1238160630-8745-1-git-send-email-avi@redhat.com> References: <1238160630-8745-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH 1/2] Fix vectored aio bounce handling immediate errors Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org 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 fd09dff..6479072 100644 --- a/block.c +++ b/block.c @@ -1306,6 +1306,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.1.1