From: Jan Kara <jack@suse.cz>
To: Asdo <asdo@shiftmail.org>
Cc: Phil Turmel <philip@turmel.org>, NeilBrown <neilb@suse.de>,
linux-raid <linux-raid@vger.kernel.org>,
linux-ext4@vger.kernel.org
Subject: Re: Sync does not flush to disk!?
Date: Fri, 8 Jun 2012 16:11:39 +0200 [thread overview]
Message-ID: <20120608141139.GD21080@quack.suse.cz> (raw)
In-Reply-To: <4FD204B0.3000204@shiftmail.org>
On Fri 08-06-12 15:57:04, Asdo wrote:
> On 06/08/12 15:49, Phil Turmel wrote:
> >
> >To put it another way: You can't safely access ext filesystems via
> >raw devices in two systems. The kernel cache won't be synchronized,
> >and you almost certainly *will* corrupt the contents.
>
> Thanks both of you for your explanations
>
> I might say that it seems to me a bad design: never before I saw a
> cache that is not updated by writes.
> Here the cache content is *older* than the data on the real devices!?
> if it was *newer*, there are known cases (writeback cache not
> flushed yet), but *older*... never seen.
Well, the problem is in inconsistency of caches. There is one cache -
page cache - used by filesystems to read & write file data which is
addressed by inode, offset. And there is another cache caching the whole
device addressed by device, offset. It would be too costly to keep both
these caches consistent and most people don't care so we don't.
BTW, if you configured KVM to use direct IO or virt IO when accessing the
devices (a good idea anyway), you wouldn't have the problems either.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2012-06-08 14:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-08 9:53 Sync does not flush to disk!? Asdo
2012-06-08 11:39 ` Asdo
2012-06-08 12:33 ` NeilBrown
2012-06-08 13:49 ` Phil Turmel
2012-06-08 13:57 ` Asdo
2012-06-08 14:11 ` Jan Kara [this message]
2012-06-08 14:16 ` Jan Kara
2012-06-08 18:28 ` Ted Ts'o
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=20120608141139.GD21080@quack.suse.cz \
--to=jack@suse.cz \
--cc=asdo@shiftmail.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
--cc=philip@turmel.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).