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>