generic: test fsync of file with 0 links and extents

Create two files, the first one with some data, and then fsync both
files. The first file is fsynced after removing its hardlink. After a
power failure we expect the fs to be mountable and for only the second
file to be present.

This exercises an issue found in btrfs and fixed by the following patch:

  btrfs: fix log tree replay failure due to file with 0 links and extents

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
5 files changed