From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MJAhS-0000Av-Rh for qemu-devel@nongnu.org; Tue, 23 Jun 2009 14:26:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MJAhN-0008VR-TW for qemu-devel@nongnu.org; Tue, 23 Jun 2009 14:26:30 -0400 Received: from [199.232.76.173] (port=45304 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJAhN-0008V7-LM for qemu-devel@nongnu.org; Tue, 23 Jun 2009 14:26:25 -0400 Received: from verein.lst.de ([213.95.11.210]:32977) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1MJAhN-0008Ac-7O for qemu-devel@nongnu.org; Tue, 23 Jun 2009 14:26:25 -0400 Date: Tue, 23 Jun 2009 20:26:22 +0200 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH] block: Clean up after deleting BHs Message-ID: <20090623182622.GA5804@lst.de> References: <1245763236-23464-1-git-send-email-avi@redhat.com> <20090623165006.GC27211@lst.de> <4A41095D.7070608@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A41095D.7070608@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Christoph Hellwig , qemu-devel@nongnu.org On Tue, Jun 23, 2009 at 07:57:01PM +0300, Avi Kivity wrote: > >I think not having the state of the private acb area cleared over a > >free/realloc cycle is pretty dangerous. Wouldn't it be better to always > >clear that space in qemu_aio_get? > > > > Maybe, but that's a bigger change. Let's start with this (in stable- > too) and rework aio later. It's actually smaller - half the size to be exact :) Signed-off-by: Christoph Hellwig Index: qemu/block.c =================================================================== --- qemu.orig/block.c 2009-06-23 20:16:48.283930485 +0200 +++ qemu/block.c 2009-06-23 20:16:57.158834441 +0200 @@ -1515,6 +1515,7 @@ void *qemu_aio_get(AIOPool *pool, BlockD acb->bs = bs; acb->cb = cb; acb->opaque = opaque; + memset(acb + 1, 0, pool->aiocb_size - sizeof(BlockDriverAIOCB)); return acb; }