fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: schumaker.anna@gmail.com
To: fstests@vger.kernel.org, linux-nfs@vger.kernel.org
Cc: Anna.Schumaker@Netapp.com
Subject: [PATCH 2/2] generic: 448 shouldn't delete $BASE_TEST_FILE if it isn't set yet
Date: Fri, 18 Oct 2019 13:33:43 -0400	[thread overview]
Message-ID: <20191018173343.303032-2-Anna.Schumaker@Netapp.com> (raw)
In-Reply-To: <20191018173343.303032-1-Anna.Schumaker@Netapp.com>

From: Anna Schumaker <Anna.Schumaker@Netapp.com>

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@Netapp.com>
---
 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


  reply	other threads:[~2019-10-18 17:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18 17:33 [PATCH 1/2] generic: Create new outfile for 035 over NFS schumaker.anna
2019-10-18 17:33 ` schumaker.anna [this message]
2019-10-20 13:50   ` [PATCH 2/2] generic: 448 shouldn't delete $BASE_TEST_FILE if it isn't set yet Eryu Guan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191018173343.303032-2-Anna.Schumaker@Netapp.com \
    --to=schumaker.anna@gmail.com \
    --cc=Anna.Schumaker@Netapp.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).