From: Qu Wenruo Date: Wed, 25 Jun 2025 23:20:21 +0000 (+0930) Subject: common/rc: add btrfs support for _small_fs_size_mb() X-Git-Tag: v2025.07.13~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=de07c1558ce0f3bb32d493ec244e19beecc93379;p=xfstests-dev.git common/rc: add btrfs support for _small_fs_size_mb() [FAILURE] With the incoming shutdown ioctl and remove_bdev callback support, btrfs is able to run the shutdown group. However test case like generic/042 fails on btrfs: generic/042 9s ... [failed, exit status 1]- output mismatch (see /home/adam/xfstests/results//generic/042.out.bad) --- tests/generic/042.out 2022-05-11 11:25:30.763333331 +0930 +++ /home/adam/xfstests/results//generic/042.out.bad 2025-06-26 08:43:56.078509452 +0930 @@ -1,10 +1 @@ QA output created by 042 -falloc -k -wrote 65536/65536 bytes at offset 0 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -fpunch -wrote 65536/65536 bytes at offset 0 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ... (Run 'diff -u /home/adam/xfstests/tests/generic/042.out /home/adam/xfstests/results//generic/042.out.bad' to see the entire diff) Ran: generic/042 Failures: generic/042 Failed 1 of 1 tests [CAUSE] The full output shows the reason directly: ERROR: '/mnt/scratch/042.img' is too small to make a usable filesystem ERROR: minimum size for each btrfs device is 114294784 And the helper _small_fs_size_mb() doesn't support btrfs, thus the small 25M file is not large enough to support a btrfs. [FIX] Fix the false alert by adding btrfs support in _small_fs_size_mb(). The btrfs minimal size is depending on the profiles even on a single device, e.g. DUP data will cost extra space. So here we go safe by using 512MiB as the minimal size for btrfs. Signed-off-by: Qu Wenruo Reviewed-by: Naohiro Aota Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- diff --git a/common/rc b/common/rc index c6393576..b7e95f03 100644 --- a/common/rc +++ b/common/rc @@ -1237,6 +1237,11 @@ _small_fs_size_mb() # it will change again. So just set it 128M. fs_min_size=128 ;; + btrfs) + # Minimal btrfs size depends on the profiles, for single device + # case, 512M should be enough. + fs_min_size=512 + ;; esac (( size < fs_min_size )) && size="$fs_min_size"