From: Stefan Hajnoczi <stefanha@gmail.com>
To: Liu Yuan <namei.unix@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
sheepdog@lists.wpkg.org, qemu-devel@nongnu.org,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] sheepdog: fix dynamic grow for running qcow2 format
Date: Mon, 16 Dec 2013 17:04:28 +0100 [thread overview]
Message-ID: <20131216160428.GC16756@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1386955768-31830-1-git-send-email-namei.unix@gmail.com>
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: qemu-devel@nongnu.org
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Stefan Hajnoczi <stefanha@redhat.com>
> Reported-by: Hadrien KOHL <hadrien.kohl@gmail.com>
> Signed-off-by: Liu Yuan <namei.unix@gmail.com>
> ---
> 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
prev parent reply other threads:[~2013-12-16 16:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-13 17:29 [Qemu-devel] [PATCH] sheepdog: fix dynamic grow for running qcow2 format Liu Yuan
2013-12-16 16:04 ` Stefan Hajnoczi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131216160428.GC16756@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=kwolf@redhat.com \
--cc=namei.unix@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=sheepdog@lists.wpkg.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).