Re: [PATCH 1/2] common: refactor fail_make_request boilerplate

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

 



On Tue, Jul 26, 2022 at 12:49:00PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@xxxxxxxxxx>
> 
> Refactor the control functions from generic/019 into a common helper to
> be used by all three tests that use fail_make_requests.

There is btrfs/271 as well with similar boilerplate as well, which
is why I've been looking into refactoring it before.

> +_start_fail_scratch_dev()
> +{
> +    local SYSFS_BDEV=`_sysfs_dev $SCRATCH_DEV`
> +    echo "Force SCRATCH_DEV device failure"
> +    echo " echo 1 > $SYSFS_BDEV/make-it-fail" >> $seqres.full
> +    echo 1 > $SYSFS_BDEV/make-it-fail
> +}

.. and for that use cases we need to pass an explicit device here, and
not just default to $SCRATCH_DEV.  

>  enable_io_failure()
>  {
> +	_allow_fail_make_request 100 1000 > /dev/null
> +	_start_fail_scratch_dev > /dev/null
>  }
>  
>  disable_io_failure()
>  {
> +	_stop_fail_scratch_dev > /dev/null
> +	_disallow_fail_make_request > /dev/null
>  }

Let's just drop these wrappers.

Otherwise this looks really nice.



[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