All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Tony Breeds <tony@bakeyournoodle.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	qemu-devel@nongnu.org, "Max Reitz" <mreitz@redhat.com>,
	"Pádraig Brady" <pbrady@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Michael Steffens" <michael_steffens@posteo.de>
Subject: Re: [Qemu-devel] [PATCH] block/raw-posix: use seek_hole ahead of fiemap
Date: Thu, 25 Sep 2014 08:21:27 +0200	[thread overview]
Message-ID: <87d2akdxug.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <1411622627-22110-1-git-send-email-tony@bakeyournoodle.com> (Tony Breeds's message of "Thu, 25 Sep 2014 15:23:47 +1000")

Please copy Kevin & Stefan for block patches.  Doing that for you.  I
also copy Max, who left his fingerprints on commit 4f11aa8.

Tony Breeds <tony@bakeyournoodle.com> writes:

> The command
>   qemu-img convert -O raw inputimage.qcow2 outputimage.raw
>
> intermittently creates corrupted output images, when the input image is not yet fully synchronized to disk.  This patch preferese the use of seek_hole checks to determine if the sector is present in the disk image.
>
> While we're there modify try_fiemap() to set FIEMAP_FLAG_SYNC.
>
> Reported-By: Michael Steffens <michael_steffens@posteo.de>
> CC: Pádraig Brady <pbrady@redhat.com>
> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
> ---
>  block/raw-posix.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/block/raw-posix.c b/block/raw-posix.c
> index a253697..b438c54 100644
> --- a/block/raw-posix.c
> +++ b/block/raw-posix.c
> @@ -1472,7 +1472,7 @@ static int64_t try_fiemap(BlockDriverState *bs, off_t start, off_t *data,
>  
>      f.fm.fm_start = start;
>      f.fm.fm_length = (int64_t)nb_sectors * BDRV_SECTOR_SIZE;
> -    f.fm.fm_flags = 0;
> +    f.fm.fm_flags = FIEMAP_FLAG_SYNC;
>      f.fm.fm_extent_count = 1;
>      f.fm.fm_reserved = 0;
>      if (ioctl(s->fd, FS_IOC_FIEMAP, &f) == -1) {
> @@ -1561,9 +1561,9 @@ static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *bs,
>  
>      start = sector_num * BDRV_SECTOR_SIZE;
>  
> -    ret = try_fiemap(bs, start, &data, &hole, nb_sectors, pnum);
> +    ret = try_seek_hole(bs, start, &data, &hole, pnum);
>      if (ret < 0) {
> -        ret = try_seek_hole(bs, start, &data, &hole, pnum);
> +        ret = try_fiemap(bs, start, &data, &hole, nb_sectors, pnum);
>          if (ret < 0) {
>              /* Assume everything is allocated. */
>              data = 0;

  reply	other threads:[~2014-09-25  6:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-25  5:23 [Qemu-devel] [PATCH] block/raw-posix: use seek_hole ahead of fiemap Tony Breeds
2014-09-25  6:21 ` Markus Armbruster [this message]
2014-09-25  6:29   ` Tony Breeds
2014-09-25  6:42     ` Greg Kurz
2014-09-25  6:48       ` Tony Breeds
2014-09-25  6:47     ` Markus Armbruster
2014-09-25  7:30   ` Kevin Wolf
2014-09-25  9:00     ` Tony Breeds
2014-09-25  9:52       ` Kevin Wolf
2014-09-25 10:41       ` Pádraig Brady
2014-09-25 12:45     ` Eric Blake
2014-09-25 12:40 ` Eric Blake
2014-09-25 23:14 ` [Qemu-devel] [PATCH v2 1/2] block/raw-posix: Fix disk corruption in try_fiemap Tony Breeds
2014-09-25 23:14   ` [Qemu-devel] [PATCH v2 2/2] block/raw-posix: use seek_hole ahead of fiemap Tony Breeds
2014-09-26 17:04     ` Max Reitz
2014-09-26 17:22     ` Eric Blake
2014-09-26 17:05   ` [Qemu-devel] [PATCH v2 1/2] block/raw-posix: Fix disk corruption in try_fiemap Max Reitz
2014-09-26 17:09   ` Eric Blake
2014-09-26 22:15     ` Tony Breeds
2014-10-14 12:35   ` Kevin Wolf

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=87d2akdxug.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=michael_steffens@posteo.de \
    --cc=mreitz@redhat.com \
    --cc=pbrady@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=tony@bakeyournoodle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.