All of lore.kernel.org
 help / color / mirror / Atom feed
* f2fs data write ordering
@ 2015-07-23 17:02 Jialin Li
  2015-07-23 18:09 ` Jaegeuk Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Jialin Li @ 2015-07-23 17:02 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: Xi Wang

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

------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-23 18:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23 17:02 f2fs data write ordering Jialin Li
2015-07-23 18:09 ` Jaegeuk Kim

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.