From: David Sterba <dsterba@suse.cz>
To: Jayashree Mohan <jayashree2912@gmail.com>
Cc: Chris Mason <clm@fb.com>,
linux-btrfs <linux-btrfs@vger.kernel.org>,
fstests <fstests@vger.kernel.org>,
Vijaychidambaram Velayudhan Pillai <vijay@cs.utexas.edu>,
Filipe Manana <fdmanana@kernel.org>
Subject: Re: Inconsistent behavior of fsync in btrfs
Date: Fri, 27 Apr 2018 18:07:40 +0200 [thread overview]
Message-ID: <20180427160740.GD21272@twin.jikos.cz> (raw)
In-Reply-To: <CA+EzBbBaZjcdHi4O4W8LZ2JvpYhN_hFGvktaeFYRfSygW3sK7A@mail.gmail.com>
On Thu, Apr 26, 2018 at 07:59:23PM -0500, Jayashree Mohan wrote:
> Thanks for the response. We are using a tool we developed called
> CrashMonkey[1] to run crash consistency tests and generate the bug
> reports above. We'd be happy to guide you through setting up
> CrashMonkey and getting these bugs reproduced. However, if you want to
> be able to reproduce them with your current setup (xfstest +
> dm-flakey), I have the workload scripts attached to the end of the
> mail which might make your task simpler.
>
> Interestingly we seem to have found another bug that breaks rename
> atomicity and results in a previously fsynced file missing.
>
> Workload:
> 1. mkdir A
> 2. creat A/bar (*)
> 3. fsync A/bar
> 4. mkdir B
> 5. creat B/bar
> 6. rename B/bar A/bar
> 7. creat A/foo
> 8. fsync A/foo
> 9. fsync A
> --- crash---
>
> When we recover from the crash, we see that file A/bar goes missing.
> If the rename did not persist, we expect to see A/bar(*) created in
> step 2 above, or if the rename indeed persisted, we still expect file
> A/bar to be present.
I'm no fsync expert and the lack of standard or well defined behaviour
(mentioned elsewhere) leads me to question, on what do you base your
expectations? Not only for this report, but in general during your
testing.
Comparing various filesystems will show that at best it's implementation
defined and everybody has their own reasons for doing it one way or
another, or request fsync at particular time etc.
We have a manual page in section 5 that contains general topics of
btrfs, so documenting the fsync specifics would be good.
next prev parent reply other threads:[~2018-04-27 16:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 2:35 Inconsistent behavior of fsync in btrfs Jayashree Mohan
2018-04-25 3:08 ` Chris Murphy
[not found] ` <CAJCQCtT7S9Qb-m3-7EXJPwtMT9nuUJjDykHi915KU+fc4fB-aQ@mail.gmail.com>
2018-04-25 3:10 ` Vijaychidambaram Velayudhan Pillai
2018-04-25 3:16 ` Vijaychidambaram Velayudhan Pillai
2018-04-25 12:36 ` Ashlie Martinez
2018-04-25 13:53 ` Ashlie Martinez
2018-04-26 16:28 ` Chris Mason
2018-04-27 0:59 ` Jayashree Mohan
2018-04-27 15:26 ` Chris Mason
2018-04-27 16:07 ` David Sterba [this message]
2018-04-27 17:33 ` Chris Mason
2018-04-27 20:53 ` Theodore Y. Ts'o
2018-04-27 23:24 ` Chris Murphy
2018-04-27 23:44 ` Jayashree Mohan
2018-04-29 20:55 ` Vijay Chidambaram
2018-04-29 22:16 ` Theodore Y. Ts'o
2018-04-29 23:21 ` Vijay Chidambaram
2018-04-30 14:30 ` Chris Mason
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=20180427160740.GD21272@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=clm@fb.com \
--cc=fdmanana@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=jayashree2912@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=vijay@cs.utexas.edu \
/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