[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH] block: fix memory leak in early exit
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-block] [PATCH] block: fix memory leak in early exit |
Date: |
Fri, 16 Oct 2015 08:58:12 +0200 |
User-agent: |
Notmuch/0.13.2 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) |
On Thu 15 Oct 2015 05:54:27 PM CEST, Stefan Hajnoczi <address@hidden> 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 <address@hidden>
> Cc: Jeff Cody <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
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 <address@hidden>
Berto