qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] sheepdog: fix dynamic grow for running qcow2 fo


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] sheepdog: fix dynamic grow for running qcow2 format
Date: Mon, 16 Dec 2013 17:04:28 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Dec 14, 2013 at 01:29:28AM +0800, Liu Yuan wrote:
> When running qcow2 over sheepdog, we might meet following problem
> 
>   qemu-system-x86_64: shrinking is not supported
> 
> And cause IO errors to Guest. This is because we abuse bs->total_sectors, 
> which
> is manipulated by generic block layer and race with sheepdog code.
> 
> We should directly check if offset > vdi_size to dynamically enlarge the 
> volume
> instead of 'offset > bs->total_sectors', which will cause problem when 
> following
> case happens:
> 
>    vdi_size > offset > bs->total_sectors
> 
>    # then trigger sd_truncate() to shrink the volume wrongly.
> 
> Cc: address@hidden
> Cc: Kevin Wolf <address@hidden>
> Cc: Stefan Hajnoczi <address@hidden>
> Reported-by: Hadrien KOHL <address@hidden>
> Signed-off-by: Liu Yuan <address@hidden>
> ---
>  block/sheepdog.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

block.c already updates bs->total_sectors if bs->growable so this patch
is safe.

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]