]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
btrfs/076: support smaller extent size limit
authorNaohiro Aota <naohiro.aota@wdc.com>
Fri, 15 Sep 2023 07:25:10 +0000 (16:25 +0900)
committerZorro Lang <zlang@kernel.org>
Wed, 20 Sep 2023 07:49:54 +0000 (15:49 +0800)
commitf4c7dbbb4f166996d8fefdebbceacd2f7d359dee
treef4cd8292fc8bb564d8022902c8763e786c52d499
parent79650397e1d1884a981de33464bddd055d7c1143
btrfs/076: support smaller extent size limit

Running btrfs/076 on a zoned null_blk device will fail with the following error.

  - output mismatch (see /host/results/btrfs/076.out.bad)
      --- tests/btrfs/076.out     2021-02-05 01:44:20.000000000 +0000
      +++ /host/results/btrfs/076.out.bad 2023-09-15 01:49:36.000000000 +0000
      @@ -1,3 +1,3 @@
       QA output created by 076
      -80
      -80
      +83
      +83
      ...

This is because the default value of zone_append_max_bytes is 127.5 KB
which is smaller than BTRFS_MAX_UNCOMPRESSED (128K). So, the extent size is
limited to 126976 (= ROUND_DOWN(127.5K, 4096)), which makes the number of
extents larger, and fails the test.

Instead of hard-coding the number of extents, we can calculate it using the
max extent size of an extent. It is limited by either
BTRFS_MAX_UNCOMPRESSED or zone_append_max_bytes.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/076
tests/btrfs/076.out