From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R21MX-000215-Rg for qemu-devel@nongnu.org; Fri, 09 Sep 2011 09:43:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R21MT-0002F0-UT for qemu-devel@nongnu.org; Fri, 09 Sep 2011 09:43:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R21MT-0002Es-MM for qemu-devel@nongnu.org; Fri, 09 Sep 2011 09:43:17 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p89DhGgk014895 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 9 Sep 2011 09:43:16 -0400 Message-ID: <4E6A17F2.1030705@redhat.com> Date: Fri, 09 Sep 2011 15:43:14 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1024719509.1142051.1315572205133.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> <4E6A0D97.60606@redhat.com> <4E6A10A7.2010709@redhat.com> <4E6A15E1.7010009@redhat.com> In-Reply-To: <4E6A15E1.7010009@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/5] dma-helpers: rewrite completion/cancellation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org On 09/09/2011 03:34 PM, Kevin Wolf wrote: > So the release that we avoid is the release in the callback that may or > may not be called indirectly by bdrv_aio_cancel. We always call > dma_complete at the end of dma_aio_cancel so that it will be properly freed. > >> In fact it may be worse than just the qemu_aio_release: if the driver is >> waiting for the request to complete, it will write over the bounce >> buffer after dma_bdrv_unmap has been called. > > How that? dma_bdrv_unmap is called only afterwards, isn't it? I had missed your point completely. :) Yes, the above should work. Paolo