qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, Markus Armbruster <armbru@redhat.com>
Cc: "Tony Breeds" <tony@bakeyournoodle.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 06:45:01 -0600	[thread overview]
Message-ID: <54240E4D.8020002@redhat.com> (raw)
In-Reply-To: <20140925073030.GA4667@noname.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2072 bytes --]

On 09/25/2014 01:30 AM, Kevin Wolf wrote:
> Am 25.09.2014 um 08:21 hat Markus Armbruster geschrieben:
>> 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.
> 
> Does this fix the problem or does it just make it less likely that it
> becomes apparent?
> 
> If there is a data corruptor, we need to fix it, not just ensure that
> only the less common environments are affected.
> 
>>> While we're there modify try_fiemap() to set FIEMAP_FLAG_SYNC.
> 
> That looks like a logically separate change, so it should probably be
> a separate patch.
> 
> Is this fix for the corruptor? The commit message doesn't make it
> clear. If so and fiemap is safe now, why would we still prefer
> seek_hole?

My understanding, based on what coreutils learned:

fiemap without FIEMAP_FLAG_SYNC is a data corrupter.  fiemap _with_
FIEMAP_FLAG_SYNC is a performance killer (noticeably slower, because it
forces a sync).  SEEK_HOLE is a much simpler interface, and therefore
the kernel can optimize it to return correct results faster than it can
for fiemap, and it does not suffer from the fiemap on unsynced file data
corruption.  So coreutils _prefers_ seek_hole first, and when it has to
use fiemap, prefers using fiemap with FIEMAP_FLAG_SYNC.

I agree with splitting this into two patches; one to add the flag as a
data corruption fix but acknowledging that it slows fiemap down, the
other to relegate fiemap to the fallback case since seek_hole can be
faster when it doesn't have to force a sync.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

  parent reply	other threads:[~2014-09-25 13:23 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
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 [this message]
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=54240E4D.8020002@redhat.com \
    --to=eblake@redhat.com \
    --cc=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 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).