]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
fstests: btrfs/301: use correct blocksize to fill the fs
authorQu Wenruo <wqu@suse.com>
Tue, 9 Dec 2025 08:52:13 +0000 (19:22 +1030)
committerZorro Lang <zlang@kernel.org>
Thu, 1 Jan 2026 13:14:26 +0000 (21:14 +0800)
commit80259c855ad782c66133e5ed06cf569857dd1f97
treeacb2f99132f09e5f2b336a3f8ad2e10c665115f7
parent657410a19ab577a946d1d8ba94e0254b5a034ab1
fstests: btrfs/301: use correct blocksize to fill the fs

[FAILURE]
When running the test with 8K fs block size (tried both 4K page size and
64K page size), the test case btrfs/301 always fail like this:

FSTYP         -- btrfs
PLATFORM      -- Linux/x86_64 btrfs-vm 6.18.0-custom+ #323 SMP PREEMPT_DYNAMIC Mon Dec  8 07:38:30 ACDT 2025
MKFS_OPTIONS  -- -s 8k /dev/mapper/test-scratch1
MOUNT_OPTIONS -- /dev/mapper/test-scratch1 /mnt/scratch

btrfs/301    42s ... - output mismatch (see /home/adam/xfstests/results//btrfs/301.out.bad)
    --- tests/btrfs/301.out 2024-01-02 14:44:11.140000000 +1030
    +++ /home/adam/xfstests/results//btrfs/301.out.bad 2025-12-09 19:14:32.057824678 +1030
    @@ -1,18 +1,71 @@
     QA output created by 301
     basic accounting
    +subvol 256 mismatched usage 41099264 vs 33964032 (expected data 33554432 expected meta 409600 diff 7135232)
    +subvol 256 mismatched usage 175316992 vs 168181760 (expected data 167772160 expected meta 409600 diff 7135232)
    +subvol 256 mismatched usage 41099264 vs 33964032 (expected data 33554432 expected meta 409600 diff 7135232)
    +subvol 256 mismatched usage 41099264 vs 33964032 (expected data 33554432 expected meta 409600 diff 7135232)
     fallocate: Disk quota exceeded
    ...
    (Run 'diff -u /home/adam/xfstests/tests/btrfs/301.out /home/adam/xfstests/results//btrfs/301.out.bad'  to see the entire diff)

[CAUSE]
Although the subvolume usage doesn't match the expectation, "btrfs check"
doesn't report any qgroup number mismatch.
This means the qgroup numbers are correct, but our expectation is not.

Upon inspection of the on-disk file extents, there are a lot of file
extents that are partially overwritten.

This means during the fio random writes, there are fs blocks that are
partially written, then written back to the storage, then written again.
This is a symptom of too small IO block size.

The default FIO blocksize is only 4K, and it will result the above
overwrite of the same fs block for 8K fs block size.

[FIX]
Add blocksize option to the fio config, so that we won't have
above over-write behavior which boost the qgroup numbers.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/301