From: Arvind Raghavan <raghavan.arvind@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: fstests@vger.kernel.org, Vijay Chidambaram <vijay@cs.utexas.edu>,
Jayashree Mohan <jayashree2912@gmail.com>
Subject: Strange sync/fsync behavior in btrfs
Date: Mon, 6 Apr 2020 14:46:51 -0500 [thread overview]
Message-ID: <CAM2wg3Sqw_a3dwjh6nQn8h-SsyM3v=43Oqce7Eq0U-Jcb7EaaA@mail.gmail.com> (raw)
Hi!
I am Arvind Raghavan, an undergraduate student at the Unversity
of Texas at Austin, working with Prof. Vijay Chidambaram. I've
been working on the Crashmonkey [1] project, which is a test
harness for file system crash consistency checks. Specifically,
we've been working on making a fuzzer to find new bugs, and we
discovered some weird behavior. Given the following workload:
mkdir A
mkdir B
mkdir A/C
creat B/foo
sync (1)
link B/foo A/C/foo
fsync A (2)
<crash>
Running on Linux 5.5.2, upon recovering the filesystem, the hard
linked file A/C/foo is not present. However, if we replace (1)
with "fsync B/foo", then upon recovery the link persists. This
behavior seems strange, as intuitively it seems that sync should
have at least as strong effect as fsync. In addition, it seems
that Chris Mason's definition of fsync guarantees here [2] might
require this workload to pass.
It is important to note that even if we skip the final fsync (2),
the result is the same. Thus, the behavior is coming only from
the syncing operation at line (1). However, we were also curious
to know whether an fsync of the directory A here (2) should
persist the file A/C/foo. Chris mentions [2] that an fsync
of a directory means that "all the files/subdirs will exist".
Should this apply to files created in subdirectories?
Thanks!
Arvind
[1] https://www.github.com/utsaslab/crashmonkey
[2] https://www.spinics.net/lists/linux-btrfs/msg77330.html
next reply other threads:[~2020-04-06 19:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-06 19:46 Arvind Raghavan [this message]
2020-04-07 10:25 ` Strange sync/fsync behavior in btrfs Filipe Manana
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='CAM2wg3Sqw_a3dwjh6nQn8h-SsyM3v=43Oqce7Eq0U-Jcb7EaaA@mail.gmail.com' \
--to=raghavan.arvind@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).