]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
generic: test fsync on inode with many hard links
authorFilipe Manana <fdmanana@suse.com>
Wed, 21 Jan 2015 05:00:01 +0000 (16:00 +1100)
committerDave Chinner <david@fromorbit.com>
Wed, 21 Jan 2015 05:00:01 +0000 (16:00 +1100)
commitdd0c4e8a35d06a5c83cb51759d7efd7c2dbadbff
tree1e8161e68f166da3ee929f4b51fd45c57a019585
parent6cf4c169e62defc45813076b037c34eda698068b
generic: test fsync on inode with many hard links

This test is motivated by an fsync issue discovered in btrfs.
The issue in btrfs was that adding a new hard link to an inode that
already had a large number of hardlinks and fsync the inode, would
make the fsync log replay code update the inode with a wrong link count
(smaller than the correct value). This resulted later in dangling
directory index entries, after removing most of the hard links
(correct_value - wrong_value), that were visible to user space but it
was impossible to delete them or do any other operation on them (since
they pointed to an inode that didn't exist anymore, resulting in -ESTALE
errors).

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

   Btrfs: fix fsync when extend references are added to an inode

This issue was present in btrfs since the extrefs (extend references)
feature was added (2012).

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/040 [new file with mode: 0755]
tests/generic/040.out [new file with mode: 0644]
tests/generic/group