fstests: generic test for directory fsync after adding hard links
authorFilipe Manana <fdmanana@suse.com>
Wed, 25 Feb 2015 04:37:54 +0000 (15:37 +1100)
committerDave Chinner <david@fromorbit.com>
Wed, 25 Feb 2015 04:37:54 +0000 (15:37 +1100)
commit036a163772697950bad537e4b7267cb9d3754147
tree8f20d6e9a2010e15bfee03a59a5c14178c90dbce
parentcd210408a0f57008c6b0af9c57cc6cc9793356bd
fstests: generic test for directory fsync after adding hard links

This test is motivated by an fsync issue discovered in btrfs.
The issue was that after adding a new hard link to an existing file
(one that was created in a past transaction) and fsync'ing the parent
directory of the new hard link, after the fsync log replay the file's
inode link count did not get its link count incremented, while the new
directory entry was visible.
Also, unlike xfs and ext4, new files under the directory we fsync were
not being written to the fsync log, nor were any child directories and
new files and links under the children directories. So this test verifies
too that btrfs has the same behaviour as xfs and ext4.

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

  Btrfs: fix metadata inconsistencies after directory fsync

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