public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Pekka Enberg <penberg@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
	Anthony Liguori <anthony@codemonkey.ws>,
	Alexander Graf <agraf@suse.de>,
	Prasad Joshi <prasadjoshi124@gmail.com>,
	Avi Kivity <avi@redhat.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	Sasha Levin <levinsasha928@gmail.com>,
	Cyrill Gorcunov <gorcunov@gmail.com>,
	Asias He <asias.hejun@gmail.com>,
	Jens Axboe <jaxboe@fusionio.com>
Subject: Re: [ANNOUNCE] Native Linux KVM tool v2
Date: Thu, 16 Jun 2011 05:48:10 -0400	[thread overview]
Message-ID: <20110616094810.GA19965@infradead.org> (raw)
In-Reply-To: <BANLkTinnSW=EEunCu_d51Mapiv=V03ncQw@mail.gmail.com>

On Thu, Jun 16, 2011 at 12:34:04PM +0300, Pekka Enberg wrote:
> Hi Christoph,
> 
> On Thu, Jun 16, 2011 at 09:21:03AM +0300, Pekka Enberg wrote:
> >> And btw, we use sync_file_range()
> 
> On Thu, Jun 16, 2011 at 12:24 PM, Christoph Hellwig <hch@infradead.org> wrote:
> > Which doesn't help you at all. ?sync_file_range is just a hint for VM
> > writeback, but never commits filesystem metadata nor the physical
> > disk's write cache. ?In short it's a completely dangerous interface, and
> > that is pretty well documented in the man page.
> 
> Doh - I didn't read it carefully enough and got hung up with:
> 
>     Therefore, unless the application is strictly performing overwrites of
>     already-instantiated disk blocks, there are no guarantees that the data will
>     be available after a crash.
> 
> without noticing that it obviously doesn't work with filesystems like
> btrfs that do copy-on-write.

You also missed:

" This system call does not flush disk write caches and thus does not
  provide any data integrity on systems with volatile disk write
  caches."

so it's not safe if you either have a cache, or are using btrfs, or
are using a sparse image, or are using an image preallocated using
fallocate/posix_fallocate.

> What's the right thing to do here? Is fdatasync() sufficient?

Yes.


  reply	other threads:[~2011-06-16  9:48 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-15 15:53 [ANNOUNCE] Native Linux KVM tool v2 Pekka Enberg
2011-06-15 16:30 ` Avi Kivity
2011-06-15 17:10   ` Pekka Enberg
2011-06-15 20:13     ` Prasad Joshi
2011-06-15 20:23       ` Sasha Levin
2011-06-15 20:49         ` Prasad Joshi
2011-06-15 21:53       ` Anthony Liguori
2011-06-15 22:04       ` Anthony Liguori
2011-06-15 22:07         ` Alexander Graf
2011-06-15 22:20           ` Anthony Liguori
2011-06-15 22:44             ` Anthony Liguori
2011-06-16  5:41               ` Pekka Enberg
2011-06-16  6:21                 ` Pekka Enberg
2011-06-16  9:24                   ` Christoph Hellwig
2011-06-16  9:34                     ` Pekka Enberg
2011-06-16  9:48                       ` Christoph Hellwig [this message]
2011-06-16  9:57                         ` Ingo Molnar
2011-06-16  9:57                         ` Pekka Enberg
2011-06-16 10:02                           ` Christoph Hellwig
2011-06-16 11:22                             ` Ingo Molnar
2011-06-16 11:25                               ` Christoph Hellwig
2011-06-16 11:40                                 ` Ingo Molnar
2011-06-16 11:51                                   ` Christoph Hellwig
2011-06-17  7:21                               ` Jeff Garzik
2011-06-16  5:45           ` Pekka Enberg
2011-06-16  7:24             ` Ingo Molnar
2011-06-16  7:33               ` Pekka Enberg
2011-06-16  8:07                 ` Ingo Molnar
2011-06-16  9:09               ` Stefan Hajnoczi
2011-06-16  5:29         ` Stefan Hajnoczi
2011-06-16  5:42           ` Pekka Enberg
2011-06-15 21:41 ` Anthony Liguori
2011-06-16 14:28 ` Michael S. Tsirkin
2011-06-16 15:01   ` Asias He
2011-06-19  8:15     ` Michael S. Tsirkin
2011-06-16 14:48 ` Pekka Enberg
2011-06-16 22:50   ` Anthony Liguori
2011-06-17  1:03     ` Sasha Levin
2011-06-17  5:00       ` Stefan Hajnoczi
2011-06-17 13:41         ` Sasha Levin
2011-06-17 13:45       ` Anthony Liguori
2011-06-17  5:11   ` Stefan Hajnoczi
2011-06-17  7:31 ` justin

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=20110616094810.GA19965@infradead.org \
    --to=hch@infradead.org \
    --cc=agraf@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=anthony@codemonkey.ws \
    --cc=asias.hejun@gmail.com \
    --cc=avi@redhat.com \
    --cc=gorcunov@gmail.com \
    --cc=jaxboe@fusionio.com \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@kernel.org \
    --cc=prasadjoshi124@gmail.com \
    --cc=torvalds@linux-foundation.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