xfs
[Top] [All Lists]

Re: snapshot regression test try 3

To: xfs mailing list <linux-xfs@xxxxxxxxxxx>
Subject: Re: snapshot regression test try 3
From: Ethan Benson <erbenson@xxxxxxxxxx>
Date: Fri, 30 Aug 2002 23:55:36 -0800
In-reply-to: <20020830223837.BODU2736.imf06bis.bellsouth.net@TAZ2>; from freemyer@NorcrossGroup.com on Fri, Aug 30, 2002 at 06:35:39PM -0400
Mail-copies-to: nobody
Mail-followup-to: xfs mailing list <linux-xfs@xxxxxxxxxxx>
References: <20020830223837.BODU2736.imf06bis.bellsouth.net@TAZ2>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
On Fri, Aug 30, 2002 at 06:35:39PM -0400, Greg Freemyer wrote:
> 
> if [ -e "$SCRATCH_SNAP_MNT" ]; then rm -rf "$SCRATCH_SNAP_MNT"; fi

ummm is $SCRATCH_SNAP_MNT normally an empty mountpoint directory? if
so please use rmdir and test its exit status (abort if rmdir fails)
don't use rm -rf since you can't be certain there isn't something
mounted there, or something stored there (shouldn't be but do you
really want to chance it? rm -rf'ing data without warning is a good
way to induce homicidal behavior)

i recommend:

if [ -e "$SCRATCH_SNAP_MNT" ]; then
        rmdir "$SCRATCH_SNAP_MNT" || exit 1
fi

-- 
Ethan Benson
http://www.alaska.net/~erbenson/

-- Attached file included as plaintext by Ecartis --

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAj1wdngACgkQJKx7GixEevxoBQCfahqAivVM3WJXGCKFdg/w1HE1
MQAAniwfD9n3fbY6G7PgTLe7/jp+L0NU
=qMMo
-----END PGP SIGNATURE-----



<Prev in Thread] Current Thread [Next in Thread>