Received: from eggs.gnu.org ([2001:4830:134:3::10]:44931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVHyd-0002Qc-7j for qemu-devel@nongnu.org; Thu, 04 Aug 2016 08:42:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVHyY-00023v-PJ for qemu-devel@nongnu.org; Thu, 04 Aug 2016 08:42:18 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:34971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVHyY-00023q-I9 for qemu-devel@nongnu.org; Thu, 04 Aug 2016 08:42:14 -0400 Received: by mail-wm0-x243.google.com with SMTP id i5so43950514wmg.2 for ; Thu, 04 Aug 2016 05:42:14 -0700 (PDT) Sender: Paolo Bonzini References: <1470142856-742-1-git-send-email-famz@redhat.com> <1470142856-742-2-git-send-email-famz@redhat.com> <891632335.13100661.1470157235734.JavaMail.zimbra@redhat.com> <20160803005242.GB8117@ad.usersys.redhat.com> From: Paolo Bonzini Message-ID: <55d8c049-9c8e-4779-d85e-233d4cffe68b@redhat.com> Date: Thu, 4 Aug 2016 14:42:09 +0200 MIME-Version: 1.0 In-Reply-To: <20160803005242.GB8117@ad.usersys.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/2] virtio-blk: Release s->rq queue at system_reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Laszlo Ersek , qemu-devel@nongnu.org, stefanha@redhat.com On 03/08/2016 02:52, Fam Zheng wrote: >> > It's also (perhaps especially) because blk_drain() can consume them. Fam's >> > patch to do blk_drain() first would cause a double-free. > That "consume" part is what I don't understand. > > Shouldn't blk_drain() only process submitted requests (and further requests > they dequeue indirectly), while s->rq only contains failed requests. Nevermind, I was confused. virtio_blk_init_request doesn't store the requests in a list, unlike SCSI. Paolo