Re: [PATCH 2/2] generic: 448 shouldn't delete $BASE_TEST_FILE if it isn't set yet

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



On Fri, Oct 18, 2019 at 01:33:43PM -0400, schumaker.anna@xxxxxxxxx wrote:
> From: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
> 
> NFS v4.2 supports SEEK_DATA and SEEK_HOLE, but earlier versions do not.
> As a result, the test exits and runs the cleanup function without the
> $BASE_TEST_FILE variable set and the shell expands it to "rm -f .*",
> deleting all hidden files in the current directory.
> 
> Signed-off-by: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
> ---
>  tests/generic/448 | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/generic/448 b/tests/generic/448
> index dada499b..d6cdebbf 100755
> --- a/tests/generic/448
> +++ b/tests/generic/448
> @@ -17,7 +17,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
>  
>  _cleanup()
>  {
> -	rm -f $tmp.* $BASE_TEST_FILE.*
> +	rm -f $tmp.*
> +	[ ! -z $BASE_TEST_FILE ] && rm -f $BASE_TEST_FILE.*
>  }

I'd just define BASE_TEST_FILE before _cleanup (and did it on commit).
Thanks for the fix!

Eryu
>  
>  # get standard environment, filters and checks
> -- 
> 2.23.0
> 



[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