]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
btrfs: verify "btrfs filesystem defragment -c" behavior
authorQu Wenruo <wqu@suse.com>
Wed, 2 Feb 2022 11:15:08 +0000 (19:15 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 13 Feb 2022 17:23:56 +0000 (01:23 +0800)
commitb91862aa4c950e0157f241136207e3827cee407e
tree5bbb707c0e2de15f54861a6bc0c947477c93aee5
parentbf49b2cde6d6a25d9174006bd7d443601fd97575
btrfs: verify "btrfs filesystem defragment -c" behavior

Despite the regular file defragging, "btrfs filesystem defragment"
provides an option, -c, to convert all data extents (except holes
and preallocated ranges) to a new compression algorithm.

The special behavior here is, unlike regular defrag which is not
going to touch extents which are adjacent to preallocated/hole
ranges, with -c, all non-hole/non-preallocated extents should be
defragged and converted to the new compression algorithm.

This test case will ensure the old behavior is properly kept.

Currently both old kernels (v5.15 and older) and newer kernel with
refactored defrag (v5.16 and newer) can pass the tests.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/btrfs/260 [new file with mode: 0755]
tests/btrfs/260.out [new file with mode: 0644]