generic: test for data loss on fsync after evicting an inode and renaming it

Check that if we write some data to a file, its inode gets evicted
(while its parent directory's inode is not evicted due to being in
use), then we rename the file and fsync it, after a power failure
the file data is not lost.

This currently passes on xfs, ext4 and f2fs but fails on btrfs. The
following patch for btrfs fixes it:

  "Btrfs: fix data loss after inode eviction, renaming it, and fsync it"

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