Re: [PATCH v2] check: Fix fs specfic imports when $FSTYPE!=$OLD_FSTYPE

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

 



On Tue, Jan 28, 2025 at 05:00:22AM +0000, Nirjhar Roy (IBM) wrote:
> Bug Description:
> 
> _test_mount function is failing with the following error:
> ./common/rc: line 4716: _xfs_prepare_for_eio_shutdown: command not found
> check: failed to mount /dev/loop0 on /mnt1/test
> 
> when the second section in local.config file is xfs and the first section
> is non-xfs.
> 
> It can be easily reproduced with the following local.config file
> 
> [s2]
> export FSTYP=ext4
> export TEST_DEV=/dev/loop0
> export TEST_DIR=/mnt1/test
> export SCRATCH_DEV=/dev/loop1
> export SCRATCH_MNT=/mnt1/scratch
> 
> [s1]
> export FSTYP=xfs
> export TEST_DEV=/dev/loop0
> export TEST_DIR=/mnt1/test
> export SCRATCH_DEV=/dev/loop1
> export SCRATCH_MNT=/mnt1/scratch
> 
> ./check selftest/001
> 
> Root cause:
> When _test_mount() is executed for the second section, the FSTYPE has
> already changed but the new fs specific common/$FSTYP has not yet
> been done. Hence _xfs_prepare_for_eio_shutdown() is not found and
> the test run fails.
> 
> Fix:
> Remove the additional _test_mount in check file just before ". commom/rc"
                                                                 common


> since ". commom/rc" is already sourcing fs specific imports and doing a
           common

> _test_mount.

This version looks good to me, I'll merge it with above changes.

Reviewed-by: Zorro Lang <zlang@xxxxxxxxxx>

I'll push this patch (if it's passed the regression test) to fix current
problem at first.

About the common/rc:init_rc we're talking about, I think we can keep
talking, and change that in another patch if need. Thanks for fixing this.

Thanks,
Zorro

> 
> Fixes: 1a49022fab9b4 ("fstests: always use fail-at-unmount semantics for XFS")
> Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@xxxxxxxxx>
> ---
>  check | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/check b/check
> index 607d2456..5cb4e7eb 100755
> --- a/check
> +++ b/check
> @@ -784,15 +784,9 @@ function run_section()
>  			status=1
>  			exit
>  		fi
> -		if ! _test_mount
> -		then
> -			echo "check: failed to mount $TEST_DEV on $TEST_DIR"
> -			status=1
> -			exit
> -		fi
> -		# TEST_DEV has been recreated, previous FSTYP derived from
> -		# TEST_DEV could be changed, source common/rc again with
> -		# correct FSTYP to get FSTYP specific configs, e.g. common/xfs
> +		# Previous FSTYP derived from TEST_DEV could be changed, source
> +		# common/rc again with correct FSTYP to get FSTYP specific configs,
> +		# e.g. common/xfs
>  		. common/rc
>  		_prepare_test_list
>  	elif [ "$OLD_TEST_FS_MOUNT_OPTS" != "$TEST_FS_MOUNT_OPTS" ]; then
> -- 
> 2.34.1
> 





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux