From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFij5-0004IM-Jc for qemu-devel@nongnu.org; Wed, 13 Mar 2013 06:16:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFij0-00038J-RA for qemu-devel@nongnu.org; Wed, 13 Mar 2013 06:16:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFij0-00038E-JT for qemu-devel@nongnu.org; Wed, 13 Mar 2013 06:15:58 -0400 Message-ID: <514051CA.5050206@redhat.com> Date: Wed, 13 Mar 2013 11:15:38 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <513DAC5B.5000607@dlhnet.de> <513DAF15.4030000@redhat.com> <74DFB48B-A0B9-49CF-AD04-477BFA275845@dlhnet.de> <513DC3AF.8030104@redhat.com> <513DC561.7080802@dlhnet.de> <20130313093145.GB2309@dhcp-200-207.str.redhat.com> In-Reply-To: <20130313093145.GB2309@dhcp-200-207.str.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] iscsi_truncate: ensure there are no requests in flight List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Jeff Cody , Peter Lieven , "qemu-devel@nongnu.org" , Anthony Liguori Il 13/03/2013 10:31, Kevin Wolf ha scritto: > Isn't the real problem that I/O requests for _this_specific_ iscsi BDS > must not be in flight? So what you reall need is bdrv_drain(iscsi_bs)? > > If I understand the code correctly, this boils down to: > > while (iscsi_process_flush(iscsilun)) { > qemu_aio_wait(); > } Yes, but this function is not doing a truncate at all. It is simply updating the cached result of bdrv_getlength. I think it makes sense that this function (which should not be truncate, but something else) expects to be called with no pending requests. It shouldn't be its task to drain them. I'll look at fixing this as mentioned in the earlier thread. Paolo