qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block: Flush image after open
Date: Mon, 21 Mar 2011 14:02:03 +0100	[thread overview]
Message-ID: <4D874C4B.5020405@redhat.com> (raw)
In-Reply-To: <4D874337.3040105@redhat.com>

Am 21.03.2011 13:23, schrieb Avi Kivity:
> On 03/09/2011 07:38 PM, Anthony Liguori wrote:
>> On 03/09/2011 11:27 AM, Christoph Hellwig wrote:
>>> On Wed, Mar 09, 2011 at 05:15:53PM +0100, Kevin Wolf wrote:
>>>> Quoting the bug report:
>>>>
>>>>      qemu ensures that guest writes and qemu metadata writes hit the 
>>>> disk
>>>>      when necessary to prevent data corruption. However, if an image 
>>>> was
>>>>      in host pagecache prior to starting qemu, for example after 
>>>> running
>>>>      qemu-img convert, then nothing prevents writes from reaching the
>>>>      disk out of order, potentially causing corruption.
>>>>
>>>> I'm not entirely sure if there is a realistic case where we would get
>>>> corruption, but it's probably a case of better safe than sorry.
>>> Except for SCSI with ordered tags (which we don't support) there are not
>>> ordering guarantees in the storage protocols, and as such the above 
>>> explanation
>>> doesn't make any sense at all.
>>
>> Even if there was, a guest shouldn't be relying on the ordering of a 
>> write that comes from a non-guest.
>>
>> I don't understand the failure scenario here.
> 
>    $ cp x.img y.img
>    $ qemu -drive file=y.img,cache=writeback
> <read something from disk, send it over the network>
> <no guest flushes>
> <host crash>
> 
> The guest may expect that any or none of its writes hit the disk, but 
> that anything that it read from the disk, stays there.

Is it true for real hardware? Consider a reboot, you could still have
some data in a volatile disk write cache if the OS that ran before the
reboot hasn't flushed it.

Kevin

  reply	other threads:[~2011-03-21 13:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-09 16:15 [Qemu-devel] [PATCH] block: Flush image after open Kevin Wolf
2011-03-09 17:27 ` Christoph Hellwig
2011-03-09 17:38   ` Anthony Liguori
2011-03-21 12:23     ` Avi Kivity
2011-03-21 13:02       ` Kevin Wolf [this message]
2011-03-21 13:21         ` Avi Kivity

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=4D874C4B.5020405@redhat.com \
    --to=kwolf@redhat.com \
    --cc=avi@redhat.com \
    --cc=hch@lst.de \
    --cc=qemu-devel@nongnu.org \
    /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).