From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUkQU-0003pL-3N for qemu-devel@nongnu.org; Tue, 02 Aug 2016 20:52:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUkQP-0001HM-Ug for qemu-devel@nongnu.org; Tue, 02 Aug 2016 20:52:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38212) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUkQP-0001H9-PZ for qemu-devel@nongnu.org; Tue, 02 Aug 2016 20:52:45 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4172D4ACC3 for ; Wed, 3 Aug 2016 00:52:45 +0000 (UTC) Date: Wed, 3 Aug 2016 08:52:42 +0800 From: Fam Zheng Message-ID: <20160803005242.GB8117@ad.usersys.redhat.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <891632335.13100661.1470157235734.JavaMail.zimbra@redhat.com> 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: Paolo Bonzini Cc: Laszlo Ersek , qemu-devel@nongnu.org, stefanha@redhat.com On Tue, 08/02 13:00, Paolo Bonzini wrote: > > > I'd prefer if Paolo's remark (about blk_drain()'s ability to produce > > more failed requests, stashed in s->rq) were captured in either the > > commit message, or in a code comment. Something like: > > > > /* We drop queued requests after blk_drain() because blk_drain() > > * itself can produce them. */ > > 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. They don't look overlap, because I suppose failed requests are only going to be processed by run state change. What am I missing? Fam