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>
This commit is contained in:
Filipe Manana
2018-10-15 09:51:17 +01:00
committed by Eryu Guan
parent b0c8d2f735
commit 2b621418f4
3 changed files with 71 additions and 0 deletions
+1
View File
@@ -514,3 +514,4 @@
509 auto quick log
510 auto quick log
511 auto quick rw zero
512 auto quick log prealloc