Skip to contentSkip to conversation

xfsqa 078 - use rmdir to remove directories

PATCH In review David Chinner 3 participants 3 messages May 22, 2008 – Jul 10, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfsqa 078 - use rmdir to remove directories

If test 078 fails and you try to run it again immediately, it will execute a 'rm -f' on a directory which will fail. This should be a rmdir....

---
 xfstests/078 |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xfstests/078 +2 -2
Index: xfs-cmds/xfstests/078
===================================================================
@@ -50,8 +50,8 @@ _filter_io()
 # real QA test starts here
 
 echo "*** create loop mount point"
-rm -f $LOOP_MNT 2>/dev/null
-mkdir $LOOP_MNT || _fail "cannot create loopback mount point"
+rmdir $LOOP_MNT 2>/dev/null
+mkdir -p $LOOP_MNT || _fail "cannot create loopback mount point"
 
 _grow_loop()
 {
#1 lore raw
Quoted 4 lines · David Chinner

If test 078 fails and you try to run it again immediately, it will execute a 'rm -f' on a directory which will fail. This should be a rmdir....

Looks good. rm -rf woul also do it, although slightly more dangerous :)

#2 lore raw
In reply to David Chinner

ping?

Quoted 27 lines · David Chinner

If test 078 fails and you try to run it again immediately, it will execute a 'rm -f' on a directory which will fail. This should be a rmdir....

---
 xfstests/078 |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: xfs-cmds/xfstests/078
===================================================================

xfstests/078 +2 -2
@@ -50,8 +50,8 @@ _filter_io()
 # real QA test starts here
 
 echo "*** create loop mount point"
-rm -f $LOOP_MNT 2>/dev/null
-mkdir $LOOP_MNT || _fail "cannot create loopback mount point"
+rmdir $LOOP_MNT 2>/dev/null
+mkdir -p $LOOP_MNT || _fail "cannot create loopback mount point"
 
 _grow_loop()
 {
Signature · 2 lines
Dave Chinner
[email protected]