On Mon, Oct 22, 2018 at 6:23 AM Jayashree Mohan <jayashree2912@xxxxxxxxx> wrote: > > On Sun, Oct 21, 2018 at 9:49 PM Amir Goldstein <amir73il@xxxxxxxxx> wrote: > > > Wait, why _scratch_shutdown and not using dm_flakey? > > Fewer filesystems support _scratch_shutdown and _scratch_shutdown > > could be buggy and not simulate crash accurately. > > Thanks for this note. I was looking at previous xfstest tests > (something not very old - generic/468 for eg), and it was using > scratch_shutdown. Hence I used that as an example. I'll use > flakey_drop_and_remount while writing up future patches. > > Doesn't this mean the current tests in xfstest suite might miss bugs > in current/future kernel versions, because some file systems don't > support it? There are many crash-consistency tests in xfstest suite > that still use _scratch_shutdown. In fact generic/468 is one of the > test cases that could not run on btrfs because it does not support > _shutdown. But then this is the exact test case required to reveal a > bug in btrfs - where you lose allocated blocks beyond the eof on > fallocate. Just wanted to bring this up, in case you did not notice it > :) > xfstests grew up with xfs having shutdown ability, so I suppose some shutdown tests test this functionality and some shutdown tests are pure crash consistency tests. Later, ext4 got shutdown support so it enjoys all this test coverage. Quite recently, Chengguang Xu added shutdown support for testing overlayfs over xfs/ext4. Note that this was done without changing kernel code. Josef Bacik added the dmflakey infrastructure to xfstests for btrfs crash tests generic/311,321. Later, I also added Josef's dmlogwrites infrastructure for crash stress tests. dmflakey and dmlogwrites _require_block_device, so they don't run on overlayfs. Now, if you write your tests with dmflakey, overlayfs will not run them and if you write your tests with shutdown, btrfs won't run them. Obviously, btrfs is more important in the context of your tests and adding dmflakey support for overlayfs is something we can do in the future. Thanks, Amir.