svn commit: r307851 - user/pho/stress2/misc

Peter Holm pho at FreeBSD.org
Mon Oct 24 07:58:16 UTC 2016


Author: pho
Date: Mon Oct 24 07:58:15 2016
New Revision: 307851
URL: https://svnweb.freebsd.org/changeset/base/307851

Log:
  Style fixes. Added missing cleanup on error exit.
  
  Sponsored by:	Dell EMC Isilon

Modified:
  user/pho/stress2/misc/umountf.sh

Modified: user/pho/stress2/misc/umountf.sh
==============================================================================
--- user/pho/stress2/misc/umountf.sh	Mon Oct 24 07:56:20 2016	(r307850)
+++ user/pho/stress2/misc/umountf.sh	Mon Oct 24 07:58:15 2016	(r307851)
@@ -37,18 +37,18 @@
 D=$diskimage
 dede $D 1m 110 || exit 1
 
-mount | grep "$mntpoint" | grep md${mdstart}${part} > /dev/null && umount $mntpoint
-mdconfig -l | grep md${mdstart} > /dev/null &&  mdconfig -d -u ${mdstart}
-
-mdconfig -a -t vnode -f $D -u ${mdstart}
-bsdlabel -w md${mdstart} auto
-newfs md${mdstart}${part}
-mount /dev/md${mdstart}${part} $mntpoint
+mount | grep "$mntpoint" | grep md${mdstart}${part} > /dev/null &&
+    umount $mntpoint
+mdconfig -l | grep md$mdstart > /dev/null &&  mdconfig -d -u $mdstart
+
+mdconfig -a -t vnode -f $D -u $mdstart || { rm $diskimage; exit 1; }
+bsdlabel -w md$mdstart auto
+newfs md${mdstart}$part > /dev/null
+mount /dev/md${mdstart}$part $mntpoint
 
 export RUNDIR=$mntpoint/stressX
 export runRUNTIME=2m
 cd ..; ./run.sh vfs.cfg > /dev/null 2>&1 &
-pid=$!
 
 sleep 30
 
@@ -56,7 +56,7 @@ umount -f $mntpoint
 mdconfig -d -u $mdstart
 rm -f $D
 
-while ps | egrep "testcases|swap|mkdir|creat" | grep -vq grep; do
-   ps | egrep "testcases|swap|mkdir|creat" | grep -v grep | awk '{print $1}' | xargs kill
-   sleep 1
+while pkill -f "swap|mkdir|creat"; do
+	sleep 1
 done
+wait


More information about the svn-src-user mailing list