linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* btrfs crash consistency bug : Blocks allocated beyond eof are lost
@ 2018-02-22  2:23 Jayashree Mohan
  2018-02-23 16:35 ` Jayashree Mohan
  0 siblings, 1 reply; 3+ messages in thread
From: Jayashree Mohan @ 2018-02-22  2:23 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Vijaychidambaram Velayudhan Pillai

Hi,

On btrfs (as of kernel 4.15), say we fallocate a file with keep_size
option, followed by fdatasync() or fsync(). If we now crash, on
recovery we see a wrong block count and all the blocks allocated
beyond the eof are lost. This bug was reported(xfstest generic/468)
and patched on ext4[1], and a variant of this, that did not recover
the correct file size was patched in f2fs[2]. I am wondering why this
is still not fixed in btrfs. You can reproduce this bug on btrfs using
a tool called CrashMonkey that we are building at UT Austin, which is
a test harness for filesystem crash consistency checks[3]

To reproduce the bug, simply run :
 ./c_harness -f /dev/sda -d /dev/cow_ram0 -t btrfs -e 102400  -v
tests/generic_468.so

Is there a reason why this is not yet patched in btrfs? I don't see
why even after a fsync(), losing the blocks allocated beyond the eof
are acceptable.

[1] https://patchwork.kernel.org/patch/10120293/
[2] https://sourceforge.net/p/linux-f2fs/mailman/message/36104201/
[3] https://github.com/utsaslab/crashmonkey

Thanks,

Jayashree Mohan
2nd Year PhD in Computer Science
University of Texas at Austin.

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

end of thread, other threads:[~2018-02-23 16:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-22  2:23 btrfs crash consistency bug : Blocks allocated beyond eof are lost Jayashree Mohan
2018-02-23 16:35 ` Jayashree Mohan
2018-02-23 16:40   ` Filipe Manana

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).