From: Bryan Schumaker <bjschuma@netapp.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: [PATCH] 273: don't delete everything if $SCRATCH_MNT isn't set
Date: Mon, 09 Apr 2012 14:36:21 -0400 [thread overview]
Message-ID: <4F832C25.3080408@netapp.com> (raw)
The cleanup function is trapped before _require_scratch() is called, and
then expands "rm -rf $SCRATCH_MNT/*" to "rm -rf /*"
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
---
273 | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/273 b/273
index 2965132..8889f5a 100755
--- a/273
+++ b/273
@@ -35,7 +35,11 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
cd /
- rm -rf $SCRATCH_MNT/* $tmp.*
+ if [ ! -z $SCRATCH_DEV ] && [ ! -z $SCRATCH_MNT ];
+ then
+ rm -rf $SCRATCH_MNT
+ fi
+ rm -rf $tmp.*
_scratch_unmount
}
--
1.7.10
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2012-04-09 18:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-09 18:36 Bryan Schumaker [this message]
2012-04-09 21:44 ` [PATCH] 273: don't delete everything if $SCRATCH_MNT isn't set Dave Chinner
2012-04-10 13:09 ` Bryan Schumaker
2012-04-11 7:24 ` Lukas Czerner
2012-04-11 20:04 ` Christoph Hellwig
2012-04-11 20:10 ` Bryan Schumaker
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=4F832C25.3080408@netapp.com \
--to=bjschuma@netapp.com \
--cc=hch@infradead.org \
--cc=xfs@oss.sgi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.