generic: test fsync after succession of renames and unlink

Test that after a combination of file renames, linking and creating
a new file with the old name of a renamed file, if we fsync the new
file, after a power failure we are able to mount the filesystem and
all file names correspond to the correct inodes.

This test is motivated by a bug found in btrfs, which is fixed by
applying the following two patches to the linux kernel:

 "[PATCH 1/2] Btrfs: fix fsync after succession of renames of different files"
 "[PATCH 2/2] Btrfs: fix fsync after succession of renames and unlink/rmdir"

The test passes on ext4, xfs and patched btrfs, however at least in
a 5.0-rc5 linux kernel, it fails on f2fs.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
3 files changed