From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zn0Vy-00047t-FD for qemu-devel@nongnu.org; Fri, 16 Oct 2015 04:37:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zn0Vx-0002y4-DM for qemu-devel@nongnu.org; Fri, 16 Oct 2015 04:37:26 -0400 Date: Fri, 16 Oct 2015 10:37:17 +0200 From: Stefan Hajnoczi Message-ID: <20151016083717.GC7432@stefanha-thinkpad.redhat.com> References: <1444924467-26433-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block: fix memory leak in early exit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Alberto Garcia , Jeff Cody , Fam Zheng , qemu-devel@nongnu.org, qemu-block@nongnu.org On Fri, Oct 16, 2015 at 08:58:12AM +0200, Alberto Garcia wrote: > On Thu 15 Oct 2015 05:54:27 PM CEST, Stefan Hajnoczi wrote: > > The stream block job has two early exit code paths. They do not free > > s->backing_file_str. > > > > Also, the early exits rely on the fact that the coroutine hasn't yielded > > yet and was launched from the main thread. Therefore the coroutine is > > guaranteed to be running in the main thread where block_job_completed() > > may be called safely. This is very subtle so it's nice to eliminate the > > assumption by unifying the early exit with the normal exit code path. > > > > Cc: Fam Zheng > > Cc: Jeff Cody > > Signed-off-by: Stefan Hajnoczi > > I had a slightly simpler version of this in my intermediate block > streaming series in case you're interested: > > https://patchwork.ozlabs.org/patch/471881/ > > But this one looks good to me too, so: > > Reviewed-by: Alberto Garcia Kevin, please take Alberto's patch instead of mine. The Message-ID is: d575a576c18d8972ac1a200c4022b39cbbce2507.1435008395.git.berto@igalia.com BTW, I notice that Jeff isn't listed as maintainer for block/stream.c. So according to MAINTAINERS this patch goes through you. Stefan