From: Jens Axboe <jens.axboe@oracle.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: device-mapper development <dm-devel@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andi Kleen <ak@suse.de>,
"MASON, CHRISTOPHER" <CHRIS.MASON@oracle.com>
Subject: Re: [dm-devel] Barriers still not passing on simple dm devices...
Date: Wed, 25 Mar 2009 16:27:51 +0100 [thread overview]
Message-ID: <20090325152751.GV27476@kernel.dk> (raw)
In-Reply-To: <Pine.LNX.4.64.0903251106520.27750@hs20-bc2-1.build.redhat.com>
On Wed, Mar 25 2009, Mikulas Patocka wrote:
> > > > Over time we should have support everywhere, but it needs to be checked,
> > > > audited, and trusted.
> > >
> > > BTW. What is the rule for barriers if the device can't prevent the
> > > requests from being delayed or reordered? (for example ATA<=3 disks with
> > > cache that lack cache-flush command ... or flash cards that do
> > > write-caching anyway and it can't be turned off). Should they support
> > > barriers and try to make best effort? Or should they reject barriers to
> > > inform the caller code that they have no data consistency?
> >
> > If they can't flush cache, then they must reject barriers unless they
> > have write through caching.
>
> ... and you suppose that journaled filesystems will use this error and
> mark filesystem for fsck if they are running over a device that doesn't
> support consistency?
No, but they can warn that data consistency isn't guarenteed. And they
all do, if you mount with barriers enabled and the barrier write fails.
If barriers aren't support, the first one will fail. So either they do
lazy detect, or they do a trial barrier write at mount time.
So yes, I suppose that file systems will use this error. Because that is
what they do.
> In theory it would be nice, in practice it doesn't work this way because
> many devices *DO* support data consistency don't support barriers (the
> most common are DM and MD when run over disk without write cache).
Your theory is nice, but most dm systems use write back caching. Any
desktop uses write back caching. Only higher end disks default to
write-through caching.
> So I think there should be flag (this device does/doesn't support data
> consistency) that the journaled filesystems can use to mark the disk dirty
> for fsck. And if you implement this flag, you can accept barriers always
> to all kind of devices regardless of whether they support consistency. You
> can then get rid of that -EOPNOTSUPP and simplify filesystem code because
> they'd no longer need two commit paths and a clumsy way to restart
> -EOPNOTSUPPed requests.
And my point is that this case isn't interesting, because most setups
don't guarantee proper ordering. The error handling is complex, no doubt
about that. But the trial barrier test is pretty trivial and even could
be easily abstracted out. If a later barrier write fails, then that's
really no different than if a normal write fails. Error handling is not
easy in that case.
--
Jens Axboe
next prev parent reply other threads:[~2009-03-25 15:28 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-23 19:04 Barriers still not passing on simple dm devices Eric Sandeen
2009-03-23 19:10 ` Eric Sandeen
2009-03-24 14:02 ` [dm-devel] " Mikulas Patocka
2009-03-24 14:05 ` Jens Axboe
2009-03-24 14:26 ` Mikulas Patocka
2009-03-24 14:30 ` Jens Axboe
2009-03-24 14:45 ` Mikulas Patocka
2009-03-24 15:05 ` Jens Axboe
2009-03-25 15:15 ` Mikulas Patocka
2009-03-25 15:27 ` Jens Axboe [this message]
2009-03-25 22:39 ` Mikulas Patocka
2009-03-26 8:42 ` Jens Axboe
2009-03-31 3:39 ` Mikulas Patocka
2009-03-31 10:49 ` Jens Axboe
2009-04-02 23:40 ` Mikulas Patocka
2009-04-03 8:11 ` Jens Axboe
2009-04-04 15:20 ` Ric Wheeler
2009-04-05 1:28 ` Theodore Tso
2009-04-05 11:54 ` Ric Wheeler
2009-04-06 1:14 ` Lee Revell
2009-04-06 1:24 ` Ric Wheeler
2009-04-08 12:44 ` Mikulas Patocka
2009-04-08 15:16 ` Henrique de Moraes Holschuh
2009-04-09 4:22 ` Eric Sandeen
2009-04-08 12:36 ` Mikulas Patocka
2009-04-08 12:54 ` Mikulas Patocka
2009-04-09 10:48 ` Ric Wheeler
2009-04-08 13:37 ` Mikulas Patocka
2009-04-08 14:06 ` Jens Axboe
2009-04-08 23:44 ` Dave Chinner
2009-04-09 1:27 ` Chris Mason
2009-04-09 10:28 ` Alasdair G Kergon
2009-03-26 12:55 ` Chris Mason
[not found] <ciXHh-39c-37@gated-at.bofh.it>
[not found] ` <cjfuL-6vJ-43@gated-at.bofh.it>
[not found] ` <cjfEl-6J2-45@gated-at.bofh.it>
[not found] ` <cjfNX-6Wh-27@gated-at.bofh.it>
2009-03-26 13:05 ` Bodo Eggert
[not found] ` <cjfXx-78D-9@gated-at.bofh.it>
[not found] ` <cjg7h-7lM-29@gated-at.bofh.it>
[not found] ` <cjgqC-80G-21@gated-at.bofh.it>
[not found] ` <cjD3I-22U-7@gated-at.bofh.it>
[not found] ` <cjDdE-2g3-31@gated-at.bofh.it>
[not found] ` <cjJVv-4vp-13@gated-at.bofh.it>
[not found] ` <cjXlS-uM-1@gated-at.bofh.it>
2009-03-26 15:26 ` Bodo Eggert
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=20090325152751.GV27476@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=CHRIS.MASON@oracle.com \
--cc=ak@suse.de \
--cc=dm-devel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mpatocka@redhat.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