From: Jialin Li <nick.lijl@gmail.com>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Xi Wang <xi@cs.washington.edu>
Subject: f2fs data write ordering
Date: Thu, 23 Jul 2015 10:02:48 -0700 [thread overview]
Message-ID: <55B11E38.8090400@gmail.com> (raw)
Hi,
When testing the crash consistency of f2fs, we saw in the documentation
that one of the mount option "nobarrier" states that "if this option is
set, no cache_flush commands are issued but f2fs still guarantees the
write ordering of all the data writes." Does it imply that both with and
without the "nobarrier" option set, the ordering of all data writes is
guaranteed? And this ordering applies to data writes to different files
too?
We wrote the following python test:
---------
import os
with open("a", "wb") as f:
f.write(b"hello\n")
with open("b", "wb") as f:
f.write(b"world\n")
os.sync()
fd0 = os.open("a", os.O_RDWR)
fd1 = os.open("b", os.O_RDWR)
os.pwrite(fd0, b'x', 1)
os.pwrite(fd1, b'y', 1)
os.fdatasync(fd1)
/* Crash here */
----------
However, after the crash, we were able to observe that file "b" on disk
contains "wyrld" while the content of file "a" is still "hello": the two
pwrites reached the disk out of order. This happened both when we set
and unset the "nobarrier" option. Maybe we misunderstood the
documentation regarding the ordering guarantee of f2fs, and it would be
much appreciated if you could provide some clarifications.
Thanks,
Jialin
------------------------------------------------------------------------------
next reply other threads:[~2015-07-23 17:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-23 17:02 Jialin Li [this message]
2015-07-23 18:09 ` f2fs data write ordering Jaegeuk Kim
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=55B11E38.8090400@gmail.com \
--to=nick.lijl@gmail.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=xi@cs.washington.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.