generic: test for file fsync after moving it to a new parent directory

Test that if we move a file from a directory B to a directory A, replace
directory B with directory A, fsync the file and then power fail, after
mounting the filesystem the file has a single parent, named B and there
is no longer any directory with the name A.

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

  "Btrfs: fix wrong dentries after fsync of file that got its parent
   replaced"

This test passes on ext4, xfs and patched btrfs but it hangs on f2fs (the
fsck.f2fs process seems stuck).

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Filipe Manana
2018-10-09 15:05:35 +01:00
committed by Eryu Guan
parent 2fdaeccead
commit 1b61fc81a5
3 changed files with 79 additions and 0 deletions
+1
View File
@@ -512,3 +512,4 @@
507 shutdown auto quick metadata
508 shutdown auto quick metadata
509 auto quick log
510 auto quick log