Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lnb7z-0005Ii-44 for qemu-devel@nongnu.org; Sat, 28 Mar 2009 12:11:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lnb7y-0005I3-Dz for qemu-devel@nongnu.org; Sat, 28 Mar 2009 12:11:22 -0400 Received: from [199.232.76.173] (port=38058 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lnb7y-0005Ho-4o for qemu-devel@nongnu.org; Sat, 28 Mar 2009 12:11:22 -0400 Received: from savannah.gnu.org ([199.232.41.3]:60899 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lnb7x-0001kC-T3 for qemu-devel@nongnu.org; Sat, 28 Mar 2009 12:11:22 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Lnb7x-0004Um-Az for qemu-devel@nongnu.org; Sat, 28 Mar 2009 16:11:21 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1Lnb7x-0004Ue-29 for qemu-devel@nongnu.org; Sat, 28 Mar 2009 16:11:21 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Sat, 28 Mar 2009 16:11:21 +0000 Subject: [Qemu-devel] [6892] Fix vectored aio bounce handling immediate errors (Avi Kivity) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6892 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6892 Author: aliguori Date: 2009-03-28 16:11:20 +0000 (Sat, 28 Mar 2009) Log Message: ----------- Fix vectored aio bounce handling immediate errors (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: Anthony Liguori Modified Paths: -------------- trunk/block.c Modified: trunk/block.c =================================================================== --- trunk/block.c 2009-03-28 15:58:58 UTC (rev 6891) +++ trunk/block.c 2009-03-28 16:11:20 UTC (rev 6892) @@ -1306,6 +1306,11 @@ 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; }