From: Christoph Hellwig <hch@lst.de>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>, qemu-devel@nongnu.org, hch@lst.de
Subject: [Qemu-devel] Re: [RFC][PATCH 2/2] qcow2: Use bdrv_(p)write_sync for metadata writes
Date: Fri, 18 Jun 2010 09:58:22 +0200 [thread overview]
Message-ID: <20100618075822.GA13682@lst.de> (raw)
In-Reply-To: <4C1B2630.1090307@redhat.com>
On Fri, Jun 18, 2010 at 09:54:24AM +0200, Kevin Wolf wrote:
> qcow2 files are expected to grow, so this probably doesn't help us. At
> best we could try to detect if the file grows and decide if to use
> sync_file_range or fdatasync.
No. sync_file_range is always unsafe for use with a real filesystem.
It never even calls into the filesystem and never flushes the disk write
cache. For our use case it's exactly a no-op.
> Of course, it would be better to have a flag or something to include the
> necessary metadata, but I have no idea how it's implemented and if this
> is easily possible.
We could add a flag to it. But rather than adding more crap to this
bastard that should never have been added I'd rather add a real
fsync_range system call.
Note that for our use case it doesn't matter anyway. For an image file
accessed with cache=none there will be no data in the pagecache, and
the writeback of the inode and associated metadata (btree blocks or
indirect blocks) will be same wether we give it a range or not, and same
for the disk cache flush.
prev parent reply other threads:[~2010-06-18 7:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-17 12:03 [Qemu-devel] [RFC][PATCH 0/2] block: Add flush after metadata writes Kevin Wolf
2010-06-17 12:03 ` [Qemu-devel] [RFC][PATCH 1/2] block: Add bdrv_(p)write_sync Kevin Wolf
2010-06-17 12:03 ` [Qemu-devel] [RFC][PATCH 2/2] qcow2: Use bdrv_(p)write_sync for metadata writes Kevin Wolf
2010-06-17 14:19 ` [Qemu-devel] " Stefan Hajnoczi
2010-06-17 14:39 ` Kevin Wolf
2010-06-17 19:47 ` Stefan Hajnoczi
2010-06-18 7:54 ` Kevin Wolf
2010-06-18 7:58 ` Christoph Hellwig [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=20100618075822.GA13682@lst.de \
--to=hch@lst.de \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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).