Re: [PATCH] common: fix rt_ops setup in _scratch_mkfs_sized

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



On Fri, Sep 08, 2023 at 02:12:34PM +0200, cem@xxxxxxxxxx wrote:
> From: Carlos Maiolino <cem@xxxxxxxxxx>
> 
> Tests using _scratch_mkfs_sized() will fail if SCRATCH_RTDEV is set,
> but, USE_EXTERNAL is not, this happens because the function pass
> "-r size=$fssize" to the _scratch_mkfs_xfs argument line, which in turn
> will not set rtdev because USE_EXTERNAL is not set.
> 
> Tests like xfs/015 will fail as:
> 
> xfs/015 6s ... [failed, exit status 1]- output mismatch
> .
> .
>     +size specified for non-existent rt subvolume
>     +Usage: mkfs.xfs
> .
> .
> 
> with this patch the test runs properly using the rtdev if USE_EXTERNAL
> is set.
> 
> Signed-off-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
> ---
> 
> Particularly I think SCRATCH_RTDEV should not depend on USE_EXTERNAL, as the
> latter is also linked to external logdevs, but I noticed tests specific for RT
> devices also set USE_EXTERNAL, so  I opted to change it according to the current
> usage

According to the fstests/README:

  Extra SCRATCH device specifications:
   - Set SCRATCH_LOGDEV to "device for scratch-fs external log"
   - Set SCRATCH_RTDEV to "device for scratch-fs realtime data"
   - If SCRATCH_LOGDEV and/or SCRATCH_RTDEV, the USE_EXTERNAL environment

So the USE_EXTERNAL should work with SCRATCH_RTDEV too. So this patch looks
good to me,

Reviewed-by: Zorro Lang <zlang@xxxxxxxxxx>

> 
>  common/rc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/rc b/common/rc
> index 1618ded5..20608fbe 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -965,7 +965,7 @@ _scratch_mkfs_sized()
>  		[ "$fssize" -gt "$devsize" ] && _notrun "Scratch device too small"
>  	fi
>  
> -	if [ "$FSTYP" = "xfs" ] && [ -b "$SCRATCH_RTDEV" ]; then
> +	if [ "$FSTYP" = "xfs" ] && [ "$USE_EXTERNAL" = yes -a -b "$SCRATCH_RTDEV" ]; then
>  		local rtdevsize=`blockdev --getsize64 $SCRATCH_RTDEV`
>  		[ "$fssize" -gt "$rtdevsize" ] && _notrun "Scratch rt device too small"
>  		rt_ops="-r size=$fssize"
> -- 
> 2.39.2
> 




[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