Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Jun 2017 07:39:46 +0000 (UTC)
From:      Peter Holm <pho@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r319647 - user/pho/stress2/misc
Message-ID:  <201706070739.v577dk7C059369@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pho
Date: Wed Jun  7 07:39:46 2017
New Revision: 319647
URL: https://svnweb.freebsd.org/changeset/base/319647

Log:
  Synchronize process termination.
  
  Sponsored by:	Dell EMC Isilon

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

Modified: user/pho/stress2/misc/crossmp.sh
==============================================================================
--- user/pho/stress2/misc/crossmp.sh	Wed Jun  7 07:38:04 2017	(r319646)
+++ user/pho/stress2/misc/crossmp.sh	Wed Jun  7 07:39:46 2017	(r319647)
@@ -35,10 +35,12 @@
 . ../default.cfg
 
 mounts=15		# Number of parallel scripts
+cont=/tmp/crossmp.continue
 mdstart=$mdstart	# Use md unit numbers from this point
 D=$diskimage
 
 if [ $# -eq 0 ]; then
+	touch $cont
 	for i in `jot $mounts`; do
 		m=$(( i + mdstart - 1 ))
 		[ ! -d ${mntpoint}$m ] && mkdir ${mntpoint}$m
@@ -68,7 +70,7 @@ if [ $# -eq 0 ]; then
 
 else
 	if [ $1 = find ]; then
-		for i in `jot 1024`; do
+		while [ -r $cont ]; do
 			find ${mntpoint}* -type f > /dev/null 2>&1
 		done
 	else
@@ -76,11 +78,12 @@ else
 		# The test: Parallel mount and unmounts
 		for i in `jot 1024`; do
 			m=$1
-			mount /dev/md${m}${part} ${mntpoint}$m
+			mount /dev/md${m}$part ${mntpoint}$m
 			while mount | grep -qw $mntpoint$m; do
 				opt=$([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-f")
 				umount $opt ${mntpoint}$m > /dev/null 2>&1
 			done
 		done
+		rm -f $cont
 	fi
 fi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706070739.v577dk7C059369>