mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
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>
This commit is contained in:
committed by
Dave Chinner
parent
f03e512ff6
commit
a8fa6ee439