Re: [PATCH v2 2/3] btrfs/146: Add _require_scratch_dev_pool before _require_dm_target

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



On Wed, Sep 08, 2021 at 05:37:14PM +0900, Shin'ichiro Kawasaki wrote:
> The test case btrfs/146 calls _require_dm_target which depends on
> SCRATCH_DEV. The test case assumes that valid devices are set in
> SCRATCH_DEV_POOL, and one of the devices is propagated to SCRATCH_DEV.
> However, when SCRATCH_DEV_POOL is not set, valid value is not propagated
> to SCRATCH_DEV and _require_dm_target causes unexpected test case
> failure. To avoid the failure, add _require_scratch_dev_pool call before
> _require_dm_target call to detect invalid SCRATCH_DEV_POOL beforehand.
> 
> Of note is that the test case replaces SCRATCH_DEV_POOL value internally
> and calls _require_scratch_dev_pool for the replaced SCRATCH_DEV_POOL.
> With this fix, the test case will call _require_scratch_dev_pool twice
> for the original SCRATCH_DEV_POOL and the replaced SCRATCH_DEV_POOL.
> 
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>
> ---
>  tests/btrfs/146 | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/btrfs/146 b/tests/btrfs/146
> index 64c3513f..eee1a286 100755
> --- a/tests/btrfs/146
> +++ b/tests/btrfs/146
> @@ -26,6 +26,7 @@ _cleanup()
>  
>  # real QA test starts here
>  _supported_fs btrfs
> +_require_scratch_dev_pool

There's no need for the test to call _require_scratch_dev_pool twice, it
doesn't do any setup work, just to make sure there's scratch pool
defined. Move both _require_scratch and _require_scratch_dev_pool up
here should be fine. I've fixed it on commit.

Thanks,
Eryu

>  _require_dm_target error
>  _require_test_program fsync-err
>  _require_test_program dmerror
> -- 
> 2.31.1



[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