generic: test fsync on inode with many hard links differently
authorFilipe Manana <fdmanana@suse.com>
Wed, 21 Jan 2015 05:01:25 +0000 (16:01 +1100)
committerDave Chinner <david@fromorbit.com>
Wed, 21 Jan 2015 05:01:25 +0000 (16:01 +1100)
commitb89defa9d8f095ea207e4e262d7ca9be66eb4ee8
tree64b5d685f6d5a0195f6d9cedb7b785e915932a45
parentdd0c4e8a35d06a5c83cb51759d7efd7c2dbadbff
generic: test fsync on inode with many hard links differently

This test is motivated by an fsync issue discovered in btrfs.
The steps to trigger the issue were:

1) remove an hard link from an inode with a large number of hard links;
2) add a new hard link;
3) add another hard link with the same name as the one removed in step 1;
4) fsync the inode.

These steps made the btrfs fsync log replay fail (with the -EOVERFLOW
error), making the filesystem unmountable, requiring the use of
btrfs-zero-log (it wipes the fsync log) in order to make the filesystem
mountable again (but losing some data/metadata).

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

  Btrfs: fix fsync when extend references are added to an inode
  Btrfs: fix fsync log replay for inodes with a mix of regular refs and extrefs

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