generic: add test for fsync after shrinking truncate and rename
authorFilipe Manana <fdmanana@suse.com>
Mon, 4 Mar 2019 14:06:22 +0000 (14:06 +0000)
committerEryu Guan <guaneryu@gmail.com>
Sat, 9 Mar 2019 10:18:52 +0000 (18:18 +0800)
commit8694a9b144d6fcaa347f6356f230bf810d3cffac
treed63478b3c15a909f1038aa3b2c2aaa170d9843d2
parent2780486bdd991bf68503b37f549043c224e0c334
generic: add test for fsync after shrinking truncate and rename

Test that if we truncate a file to reduce its size, rename it and then
fsync it, after a power failure the file has a correct size and name.

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

  "Btrfs: fix incorrect file size after shrinking truncate and fsync"

This test currently passes on ext4, xfs, f2fs and patched btrfs.

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/534 [new file with mode: 0755]
tests/generic/534.out [new file with mode: 0644]
tests/generic/group