]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
xfsqa: new fsr defragmentation test
authorDave Chinner <dchinner@redhat.com>
Wed, 28 Apr 2010 05:34:06 +0000 (15:34 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 28 Apr 2010 05:34:06 +0000 (15:34 +1000)
commita8fa6ee439c79cb6399d575e8c2e4357f906965f
treed51d5a6fe84954085bd83ffca44cc6acb7c369d1
parentf03e512ff690ca8218921c335ab64c774d3a50ff
xfsqa: new fsr defragmentation test

This test aims to recreate the conditions that caused xfs_fsr to
corrupt inode forks. The problem was that the data forks between the
two inodes were in different formats due to different inode fork
offsets, so when they swapped the data forks the formats were
invalid.

This test generates a filesystem with a known fragmented freespace pattern and
then abuses known "behaviours" of the allocator to generate files
with a known number of extents. It creates attributes to generate a
known inode fork offset, then uses a debug feature of xfs_fsr to
attempt to defrag the inode to a known number of extents.

By using these features, we can pretty much cover the entire matrix of inode
fork configurations, hence reproducing the conditions that lead to corruptions.
This test has already uncovered one bug in the current kernel code, and the
current fsr (with it's naive attribute fork handling) is aborted on a couple of
hundred of the files created by this test.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
227 [new file with mode: 0644]
227.out [new file with mode: 0644]
group