Re: [PATCH blktests v3 2/6] block/032: make error messages clearer if mkfs or mount fails

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

 



On Feb 12, 2025 / 12:54, Luis Chamberlain wrote:
> If block/032 fails at mkfs we want to know why, so propagate
> error messages. While at it, enhance the test to also propagate
> the error return from mount and remove the odd sleep for a udevadm
> settle as that's the only thing I can think of we need to wait for
> here.
> 
> Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>
> ---
>  tests/block/032 | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/block/032 b/tests/block/032
> index 8975879660d7..fc6d1a51dcad 100755
> --- a/tests/block/032
> +++ b/tests/block/032
> @@ -25,10 +25,10 @@ test() {
>  	fi
>  
>  	mkdir -p "${TMPDIR}/mnt"
> -	_xfs_mkfs_and_mount "/dev/${SCSI_DEBUG_DEVICES[0]}" "${TMPDIR}/mnt" > /dev/null 2>&1
> +	_xfs_mkfs_and_mount "/dev/${SCSI_DEBUG_DEVICES[0]}" "${TMPDIR}/mnt" >> $FULL || return $?

The $FULL needs double quotations to avoid a shellcheck warning. That change was
in the 6th patch, but let's fix it here.

When _xfs_mkfs_and_mount() fails, I think it is the better to call
_exit_scsi_debug() before returning from test(). It will clean up the scsi_debug
device, then will reduce the impact on following test cases.

>  	echo 1 > "/sys/block/${SCSI_DEBUG_DEVICES[0]}/device/delete"
> -	sleep 2
> -	umount "${TMPDIR}/mnt"
> +	udevadm settle
> +	umount "${TMPDIR}/mnt" || return $?
>  
>  	_exit_scsi_debug
>  
> -- 
> 2.45.2
> 




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux