generic: test fsync after fallocate on a very small file
authorFilipe Manana <fdmanana@suse.com>
Mon, 15 Oct 2018 08:51:17 +0000 (09:51 +0100)
committerEryu Guan <guaneryu@gmail.com>
Sun, 21 Oct 2018 09:31:48 +0000 (17:31 +0800)
commit2b621418f4e96b6af558c238f29ff1a84d901a91
treeeb42128cfcfe37e8f7d574836cd730c4b3ce6b83
parentb0c8d2f735b314c2db15663049b52aa2453b956b
generic: test fsync after fallocate on a very small file

Test that if we have a very small file, with a size smaller than the
block size, then fallocate a very small range within the block size
but past the file's current size, fsync the file and then power
fail, after mounting the filesystem all the file data is there and
the file size is correct.

This test is motivated by a failure in btrfs where it triggered an
assertion when using the no-holes feature, that is, when running
with MKFS_OPTIONS="-O no-holes". The btrfs issue is fixed by a patch
for the linux kernel titled:

 "Btrfs: fix assertion on fsync of regular file when using no-holes
  feature"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/512 [new file with mode: 0755]
tests/generic/512.out [new file with mode: 0644]
tests/generic/group