Date: Fri, 3 Feb 2017 12:01:28 +0000 (UTC) From: Peter Holm <pho@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r313147 - user/pho/stress2/misc Message-ID: <201702031201.v13C1SJ2055982@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pho Date: Fri Feb 3 12:01:28 2017 New Revision: 313147 URL: https://svnweb.freebsd.org/changeset/base/313147 Log: Do not loop for ever on pkill. Style fix. Trim runtime. Sponsored by: Dell EMC Isilon Modified: user/pho/stress2/misc/umountf.sh user/pho/stress2/misc/umountf2.sh user/pho/stress2/misc/umountf3.sh user/pho/stress2/misc/umountf5.sh Modified: user/pho/stress2/misc/umountf.sh ============================================================================== --- user/pho/stress2/misc/umountf.sh Fri Feb 3 11:51:06 2017 (r313146) +++ user/pho/stress2/misc/umountf.sh Fri Feb 3 12:01:28 2017 (r313147) @@ -56,7 +56,16 @@ umount -f $mntpoint mdconfig -d -u $mdstart rm -f $D +s=0 +n=0 while pkill -f "swap|mkdir|creat"; do sleep 1 + n=$((n + 1)) + if [ $n -gt 60 ]; then + pgrep "swap|mkdir|creat" + s=1 + break + fi done wait +exit $s Modified: user/pho/stress2/misc/umountf2.sh ============================================================================== --- user/pho/stress2/misc/umountf2.sh Fri Feb 3 11:51:06 2017 (r313146) +++ user/pho/stress2/misc/umountf2.sh Fri Feb 3 12:01:28 2017 (r313147) @@ -41,13 +41,13 @@ sed '1,/^EOF/d' < $0 > /tmp/fsx.c mycc -o /tmp/fsx -O2 /tmp/fsx.c || exit 1 -rm -f fsx.c +rm -f /tmp/fsx.c D=$diskimage dede $D 1m 1k || 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 -l | grep md$mdstart > /dev/null && mdconfig -d -u $mdstart mdconfig -a -t vnode -f $D -u $mdstart bsdlabel -w md$mdstart auto @@ -59,7 +59,7 @@ for i in `jot 100`; do done sleep 30 umount -f $mntpoint & -for i in `jot 10`; do +for i in `jot 30`; do sleep 30 pgrep -q fsx || break done Modified: user/pho/stress2/misc/umountf3.sh ============================================================================== --- user/pho/stress2/misc/umountf3.sh Fri Feb 3 11:51:06 2017 (r313146) +++ user/pho/stress2/misc/umountf3.sh Fri Feb 3 12:01:28 2017 (r313147) @@ -46,13 +46,13 @@ rm -f umountf3.c cd $odir -mount | grep "$mntpoint" | grep md${mdstart} > /dev/null && umount $mntpoint -mdconfig -l | grep md${mdstart} > /dev/null && mdconfig -d -u ${mdstart} +mount | grep "$mntpoint" | grep md$mdstart > /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} > /dev/null 2>&1 -mount /dev/md${mdstart}${part} $mntpoint +mdconfig -a -t vnode -f $D -u $mdstart +bsdlabel -w md$mdstart auto +newfs md${mdstart}$part > /dev/null 2>&1 +mount /dev/md${mdstart}$part $mntpoint export RUNDIR=$mntpoint/stressX for i in `jot 25`; do (cd /$mntpoint; /tmp/umountf3) & @@ -60,6 +60,8 @@ done sleep $((4 * 60)) echo "umount -f $mntpoint" umount -f $mntpoint +while pkill -f umountf3; do :; done +wait mdconfig -d -u $mdstart rm -f $D /tmp/umountf3 exit Modified: user/pho/stress2/misc/umountf5.sh ============================================================================== --- user/pho/stress2/misc/umountf5.sh Fri Feb 3 11:51:06 2017 (r313146) +++ user/pho/stress2/misc/umountf5.sh Fri Feb 3 12:01:28 2017 (r313147) @@ -57,8 +57,16 @@ umount -f $mntpoint mdconfig -d -u $mdstart rm -f $D +s=0 +n=0 while pkill -f "swap|mkdir|creat"; do sleep 1 + n=$((n + 1)) + if [ $n -gt 60 ]; then + pgrep "swap|mkdir|creat" + s=1 + break + fi done wait -exit 0 +exit $s
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702031201.v13C1SJ2055982>