]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
btrfs: test active zone tracking
authorNaohiro Aota <naohiro.aota@wdc.com>
Wed, 5 Oct 2022 05:46:44 +0000 (14:46 +0900)
committerZorro Lang <zlang@kernel.org>
Sat, 8 Oct 2022 11:20:25 +0000 (19:20 +0800)
commitdcf2ada66e2dcaf9d3724fb5456d0257eb01a555
treeaf421d23720baac935f53eab6539a6c0c573cfb0
parent18b44df21afcac7fd27b6c0f44923de3eadda852
btrfs: test active zone tracking

A ZNS device limits the number of active zones, which is the number of
zones can be written at the same time. To deal with the limit, btrfs's
zoned mode tracks which zone (corresponds to a block group on the SINGLE
profile) is active, and finish a zone if necessary.

This test checks if the active zone tracking and the finishing of zones
works properly. First, it fills <number of max active zones> zones
mostly. And, run some data/metadata stress workload to force btrfs to use a
new zone.

This test fails on an older kernel (e.g, 5.18.2) like below.

btrfs/273
[failed, exit status 1]- output mismatch (see /host/btrfs/273.out.bad)
    --- tests/btrfs/273.out     2022-09-15 07:52:18.000000000 +0000
    +++ /host/btrfs/273.out.bad 2022-09-15 07:59:14.290967793 +0000
    @@ -1,2 +1,5 @@
     QA output created by 273
    -Silence is golden
    +stress_data_bgs failed
    +stress_data_bgs_2 failed
    +failed: '/bin/btrfs subvolume snapshot /mnt/scratch /mnt/scratch/snap825'
    +(see /host/btrfs/273.full for details)
    ...
    (Run 'diff -u /var/lib/xfstests/tests/btrfs/273.out /host/btrfs/273.out.bad'  to see the entire diff)

The failure is fixed with a series "btrfs: zoned: fix active zone tracking
issues" [1] (upstream commits from 65ea1b66482f ("block: add bdev_max_segments()
helper") to 2ce543f47843 ("btrfs: zoned: wait until zone is finished when
allocation didn't progress")).

[1] https://lore.kernel.org/linux-btrfs/cover.1657321126.git.naohiro.aota@wdc.com/

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/zoned
tests/btrfs/273 [new file with mode: 0755]
tests/btrfs/273.out [new file with mode: 0644]