Re: [PATCH] common/rc: add btrfs support for _small_fs_size_mb()

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Thu Jun 26, 2025 at 8:20 AM JST, Qu Wenruo wrote:
> [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 <wqu@xxxxxxxx>
> ---
>  common/rc | 5 +++++
>  1 file changed, 5 insertions(+)

Looks good.

Reviewed-by: Naohiro Aota <naohiro.aota@xxxxxxx>

>
> diff --git a/common/rc b/common/rc
> index d8ee8328..2d8e7167 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1195,6 +1195,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"
>  




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux