public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 273: don't delete everything if $SCRATCH_MNT isn't set
@ 2012-04-09 18:36 Bryan Schumaker
  2012-04-09 21:44 ` Dave Chinner
  0 siblings, 1 reply; 6+ messages in thread
From: Bryan Schumaker @ 2012-04-09 18:36 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-11 20:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-09 18:36 [PATCH] 273: don't delete everything if $SCRATCH_MNT isn't set Bryan Schumaker
2012-04-09 21:44 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox