[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]



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.*
 }
 
 # 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