From: Dave Chinner <david@fromorbit.com>
To: Sage Weil <sage@newdream.net>
Cc: Josef Bacik <jbacik@fb.com>, Jan Kara <jack@suse.cz>,
lsf-pc@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org
Subject: Re: [Lsf-pc] [LSF/MM TOPIC] Working towards better power fail testing
Date: Tue, 6 Jan 2015 10:27:43 +1100 [thread overview]
Message-ID: <20150105232742.GB31508@dastard> (raw)
In-Reply-To: <alpine.DEB.2.00.1501051357480.5967@cobra.newdream.net>
On Mon, Jan 05, 2015 at 02:26:30PM -0800, Sage Weil wrote:
> On Tue, 6 Jan 2015, Dave Chinner wrote:
> > Again, this is probably more a misunderstanding of FIEMAP than
> > anything. FIEMAP is *advisory* and gives no output accuracy
> > guarantees as userspace cannot prevent the extent maps from changing
> > at any time. As an example, see the aborted attempt by the 'cp'
> > utility to use FIEMAP to detect holes when copying sparse files....
>
> Where did the cp vs FIEMAP discussion play out? I missed that one.
Oh, there were several issues - different filesystems exposed
different issues, but the main one is that extent maps don't reflect
newly written cached data that do not have extents allocated for
them, hence the nedd for SEEK_DATA/SEEK_HOLE for optimal sparse file
traversal:
http://lwn.net/Articles/429345/
http://lwn.net/Articles/440255/
Not to mention race conditions between extent walking and background
writeback started to noticed:
http://lists.openwall.net/linux-ext4/2012/11/13/8
But then there were also corruption bugs in the cp FIEMAP code as
well:
http://gnu-coreutils.7620.n7.nabble.com/bug-12656-cp-since-8-11-corrupts-files-td20710.html
> We only use fiemap to determine which file regions are holes, only after
> fsync, and only when there are no other processes or threads accessing the
> same file (and only when explicitly enabled by the admin since many users
> still have buggy implementations deployed). Under those circumstances I
> thought it should be reliable...
And when the filesystem does background defragmentation or block
trimming or some other re-organisation of recently accessed files?
> In retrospect the SEEK_HOLE/SEEK_DATA interface is simpler and better
> suited, but I'm hesitant to fall into the same trap.
SEEK_HOLE/DATA is independent of the underlying file layout, hence
it's behaviour is not affected by filesystem changing the extent
layout of the file in a manner that userspace is not aware of and
cannot control.
> > Write tests for the regression test suite that filesystem developers
> > run all the time. ;)
>
> Yes (and I assume that you specifically mean xfstests here).
*nod*
> I hope we can get some consensus on what that testing approach
> will be for power failure. I don't much care whether it's an
> ioctl each fs implements or a dm layer that does about the same
> thing; I see advantages to both approaches. As long as there is
> some convergence...
Yes, I see advantages to both, too, but there's no point creating
esoteric device error conditions if the filesystem can't correctly
handle and recover from simple shutdown situations....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2015-01-05 23:53 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-08 22:11 [LSF/MM TOPIC] Working towards better power fail testing Josef Bacik
2014-12-10 11:27 ` [Lsf-pc] " Jan Kara
2014-12-10 15:09 ` Josef Bacik
2015-01-05 18:34 ` Sage Weil
2015-01-05 19:02 ` Brian Foster
2015-01-05 19:13 ` Sage Weil
2015-01-05 19:33 ` Brian Foster
2015-01-05 21:17 ` Jan Kara
2015-01-05 21:47 ` Dave Chinner
2015-01-05 22:26 ` Sage Weil
2015-01-05 23:27 ` Dave Chinner [this message]
2015-01-06 17:37 ` Sage Weil
2015-01-06 8:53 ` Jan Kara
2015-01-06 16:39 ` Josef Bacik
2015-01-06 22:07 ` Dave Chinner
2015-01-07 10:10 ` Jan Kara
2015-01-13 17:05 ` Dmitry Monakhov
2015-01-13 17:17 ` Josef Bacik
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=20150105232742.GB31508@dastard \
--to=david@fromorbit.com \
--cc=jack@suse.cz \
--cc=jbacik@fb.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=sage@newdream.net \
/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).