generic: test fsync after unlink
authorFilipe Manana <fdmanana@suse.com>
Wed, 21 Jan 2015 04:58:23 +0000 (15:58 +1100)
committerDave Chinner <david@fromorbit.com>
Wed, 21 Jan 2015 04:58:23 +0000 (15:58 +1100)
commit6cf4c169e62defc45813076b037c34eda698068b
tree1dee45e7330c458d565799088a7e3e4f83ec037f
parent90a5c23039acf9bb14c5bdf710a4a94f04241ef0
generic: test fsync after unlink

This test is motivated by an fsync issue discovered in btrfs.
The issue was that after fsyncing an inode that got its link count
decremented, and the new link count is greater than zero, after the
fsync log replay the inode's parent directory metadata became
inconsistent - it had a wrong i_size and dangling index entries which
prevented the directory from ever being removed (rmdir always failed
with -ENOTEMPTY, even if the directory had no more child inodes).

The btrfs issue was fixed by the following linux kernel patch:

    Btrfs: fix directory inconsistency after fsync log replay

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/generic/039 [new file with mode: 0755]
tests/generic/039.out [new file with mode: 0644]
tests/generic/group