qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-stable] [PATCH] block: Prevent coroutine stack overflow when r


From: Stefan Hajnoczi
Subject: Re: [Qemu-stable] [PATCH] block: Prevent coroutine stack overflow when recursing in bdrv_open_backing_file.
Date: Wed, 23 Apr 2014 13:45:31 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Apr 22, 2014 at 05:05:27PM +0200, Benoît Canet wrote:
> In 1.7.1 qcow2_create2 reopen the file for flushing without the 
> BDRV_O_NO_BACKING
> flags.
> 
> As a consequence the code would recursively open the whole backing chain.
> 
> These three stack arrays would pile up through the recursion and lead to a 
> coroutine
> stack overflow.
> 
> Convert these array to malloced buffers in order to streamline the coroutine
> footprint.
> 
> Symptoms where freezes or segfaults on production machines while taking QMP 
> externals
> snapshots. The overflow disturbed coroutine switching.
> 
> Signed-off-by: Benoit Canet <address@hidden>
> ---
>  block.c |   32 +++++++++++++++++++-------------
>  1 file changed, 19 insertions(+), 13 deletions(-)

This is patch hints at dropping the PATH_MAX constant completely: Let's
use g_strdup()/g_strdup_printf()/etc for filenames and stop using
hard-coded limits.  But as a bug fix this patch is good.

I had to resolve conflicts against the block tree - I guess you wrote
the patch against v1.7.1.

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]