fstests: generic test for fsync after hole punching

Test that a file fsync works after punching a hole for the same file
range multiple times, and that after log/journal replay the file's
content and layout are correct.

This test is motivated by a bug found in btrfs, which is fixed by
the following linux kernel patch:

  "Btrfs: fix hole punching when using the no-holes feature"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Filipe Manana
2015-11-17 08:41:18 +11:00
committed by Dave Chinner
parent 727d47730d
commit 71f68b47e1
3 changed files with 122 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
QA output created by 177
wrote 131072/131072 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
File digest before power failure:
d26bbb9a8396a9c0dd76423471b72b15 SCRATCH_MNT/foobar
Fiemap before power failure:
0: [0..63]: data
1: [64..255]: hole
File digest after log replay:
d26bbb9a8396a9c0dd76423471b72b15 SCRATCH_MNT/foobar
Fiemap after log replay:
0: [0..63]: data
1: [64..255]: hole