From owner-svn-src-user@freebsd.org  Tue Apr 25 09:08:46 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE47ED4FF7A
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Tue, 25 Apr 2017 09:08:46 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 87F0D988;
 Tue, 25 Apr 2017 09:08:46 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3P98jUY085001;
 Tue, 25 Apr 2017 09:08:45 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3P98i4I084988;
 Tue, 25 Apr 2017 09:08:44 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704250908.v3P98i4I084988@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Tue, 25 Apr 2017 09:08:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317401 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 25 Apr 2017 09:08:46 -0000

Author: pho
Date: Tue Apr 25 09:08:44 2017
New Revision: 317401
URL: https://svnweb.freebsd.org/changeset/base/317401

Log:
  Added check for QUOTA configured.
  Style fix while here.
  
  Sponsored by:	Dell EMC Isilon

Modified:
  user/pho/stress2/misc/quota1.sh
  user/pho/stress2/misc/quota10.sh
  user/pho/stress2/misc/quota11.sh
  user/pho/stress2/misc/quota2.sh
  user/pho/stress2/misc/quota3.sh
  user/pho/stress2/misc/quota4.sh
  user/pho/stress2/misc/quota5.sh
  user/pho/stress2/misc/quota6.sh
  user/pho/stress2/misc/quota7.sh
  user/pho/stress2/misc/quota8.sh
  user/pho/stress2/misc/quota9.sh
  user/pho/stress2/misc/suj18.sh
  user/pho/stress2/misc/suj19.sh

Modified: user/pho/stress2/misc/quota1.sh
==============================================================================
--- user/pho/stress2/misc/quota1.sh	Tue Apr 25 08:34:39 2017	(r317400)
+++ user/pho/stress2/misc/quota1.sh	Tue Apr 25 09:08:44 2017	(r317401)
@@ -31,7 +31,8 @@
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
 
 # Causes this: panic: mutex Giant not owned at ../../../kern/vfs_subr.c:1968
-# with a kernel compiled with "options QUOTA"
+# with a kernel compiled with "options QUOTA".
+# This is not really a quota test.
 
 . ../default.cfg
 
@@ -39,7 +40,8 @@ D=$diskimage
 trap "rm -f $D" 0
 dede $D 1m 128 || exit 1
 
-mount | grep "$mntpoint" | grep md${mdstart}$part > /dev/null && umount $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
@@ -54,3 +56,4 @@ while mount | grep -q $mntpoint; do
 done
 mdconfig -d -u $mdstart
 rm -f $D
+exit 0

Modified: user/pho/stress2/misc/quota10.sh
==============================================================================
--- user/pho/stress2/misc/quota10.sh	Tue Apr 25 08:34:39 2017	(r317400)
+++ user/pho/stress2/misc/quota10.sh	Tue Apr 25 09:08:44 2017	(r317401)
@@ -29,8 +29,11 @@
 #
 
 # Hunt for deadlock that could occur running umount and quota at the same time
+# "panic: dqsync: file" seen:
+# https://people.freebsd.org/~pho/stress/log/quota10.txt
 
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0
 
 . ../default.cfg
 
@@ -42,18 +45,21 @@ export PATH_FSTAB=/tmp/fstab
 if [ $# -eq 0 ]; then
 	rm -f $PATH_FSTAB
 	for i in `jot $mounts`; do
-		m=$(( i + mdstart - 1 ))
+		m=$((i + mdstart - 1))
 		[ ! -d ${mntpoint}$m ] && mkdir ${mntpoint}$m
-		mount | grep "$mntpoint" | grep -q md$m && umount ${mntpoint}$m
-		mdconfig -l | grep -q md$m &&  mdconfig -d -u $m
+		mount | grep "$mntpoint" | grep -q md$m &&
+		    umount ${mntpoint}$m
+		[ -c /dev/md$m ] && mdconfig -d -u $m
 
 		dede $D$m 1m 1
 		mdconfig -a -t vnode -f $D$m -u $m
 		bsdlabel -w md$m auto
 		newfs md${m}${part} > /dev/null 2>&1
-		echo "/dev/md${m}${part} ${mntpoint}$m ufs rw,userquota 2 2" >> $PATH_FSTAB
+		echo "/dev/md${m}$part ${mntpoint}$m ufs rw,userquota 2 2" \
+		    >> $PATH_FSTAB
 		mount ${mntpoint}$m
-		edquota -u -f ${mntpoint}$m -e ${mntpoint}$m:100000:110000:15000:16000 root
+		edquota -u -f ${mntpoint}$m -e \
+		    ${mntpoint}$m:100000:110000:15000:16000 root
 		umount ${mntpoint}$m
 	done
 	sync;sync;sync
@@ -61,14 +67,14 @@ if [ $# -eq 0 ]; then
 	# start the parallel tests
 	touch /tmp/$0
 	for i in `jot $mounts`; do
-		m=$(( i + mdstart - 1 ))
+		m=$((i + mdstart - 1))
 		./$0 $m &
 		./$0 find $m &
 	done
 	wait
 
 	for i in `jot $mounts`; do
-		m=$(( i + mdstart - 1 ))
+		m=$((i + mdstart - 1))
 		mdconfig -d -u $m
 		rm -f $D$m
 	done
@@ -89,10 +95,12 @@ else
 			opt=`[ $(( m % 2 )) -eq 0 ] && echo -f`
 			mount $opt /dev/md${m}${part} ${mntpoint}$m
 			while mount | grep -qw $mntpoint$m; do
-				opt=$([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-f")
+				opt=$([ $((`date '+%s'` % 2)) -eq 0 ] &&
+				    echo "-f")
 				umount $opt ${mntpoint}$m > /dev/null 2>&1
 			done
 		done
 		rm -f /tmp/$0
 	fi
 fi
+exit 0

Modified: user/pho/stress2/misc/quota11.sh
==============================================================================
--- user/pho/stress2/misc/quota11.sh	Tue Apr 25 08:34:39 2017	(r317400)
+++ user/pho/stress2/misc/quota11.sh	Tue Apr 25 09:08:44 2017	(r317401)
@@ -35,6 +35,7 @@
 # Test scenario by Hiroki Sato <hrs FreeBSD org>
 
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0
 
 . ../default.cfg
 
@@ -58,7 +59,11 @@ dd if=/dev/random of=$mntpoint/foo.data 
 kill $!
 wait
 
+n=0
 while mount | grep "on $mntpoint " | grep -q /dev/md; do
 	umount $mntpoint || sleep 1
+	n=$((n + 1))
+	[ $n -gt 60 ] && exit 1
 done
 mdconfig -d -u $mdstart
+exit 0

Modified: user/pho/stress2/misc/quota2.sh
==============================================================================
--- user/pho/stress2/misc/quota2.sh	Tue Apr 25 08:34:39 2017	(r317400)
+++ user/pho/stress2/misc/quota2.sh	Tue Apr 25 09:08:44 2017	(r317401)
@@ -29,6 +29,7 @@
 #
 
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0
 
 . ../default.cfg
 
@@ -50,8 +51,9 @@ quotacheck $mntpoint
 quotaon $mntpoint
 export RUNDIR=${mntpoint}/stressX
 export runRUNTIME=10m            # Run tests for 10 minutes
-(cd ..; ./run.sh disk.cfg)
+(cd ..; ./run.sh disk.cfg) 2>/dev/null
 while mount | grep $mntpoint | grep -q /dev/md; do
 	umount $mntpoint || sleep 1
 done
 mdconfig -d -u $mdstart
+exit 0

Modified: user/pho/stress2/misc/quota3.sh
==============================================================================
--- user/pho/stress2/misc/quota3.sh	Tue Apr 25 08:34:39 2017	(r317400)
+++ user/pho/stress2/misc/quota3.sh	Tue Apr 25 09:08:44 2017	(r317401)
@@ -29,6 +29,7 @@
 #
 
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0
 
 . ../default.cfg
 

Modified: user/pho/stress2/misc/quota4.sh
==============================================================================
--- user/pho/stress2/misc/quota4.sh	Tue Apr 25 08:34:39 2017	(r317400)
+++ user/pho/stress2/misc/quota4.sh	Tue Apr 25 09:08:44 2017	(r317401)
@@ -29,6 +29,7 @@
 #
 
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0
 
 # Has shown a deadlock after 7 hours of testing
 # https://people.freebsd.org/~pho/stress/log/quota4.txt
@@ -39,23 +40,28 @@ D=$diskimage
 trap "rm -f $D" 0
 dede $D 1m 1k || exit 1
 
-mount | grep "${mntpoint}" | grep md${mdstart}${part} > /dev/null && umount ${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}
 bsdlabel -w md${mdstart} auto
-newfs $newfs_flags  md${mdstart}${part} > /dev/null
-echo "/dev/md${mdstart}${part} ${mntpoint} ufs rw,userquota 2 2" >> /etc/fstab
-mount ${mntpoint}
-edquota -u -f ${mntpoint} -e ${mntpoint}:850000:900000:130000:140000 root > /dev/null 2>&1
-quotaon ${mntpoint}
+newfs $newfs_flags  md${mdstart}$part > /dev/null
+echo "/dev/md${mdstart}$part $mntpoint ufs rw,userquota 2 2" >> \
+    /etc/fstab
+mount $mntpoint
+edquota -u -f $mntpoint -e ${mntpoint}:850000:900000:130000:140000 root \
+    > /dev/null 2>&1
+quotaon $mntpoint
 sed -i -e "/md${mdstart}${part}/d" /etc/fstab	# clean up before any panics
 export RUNDIR=${mntpoint}/stressX
-../testcases/rw/rw -t 2m -i 200 -h -n -v -v&
+../testcases/rw/rw -t 2m -i 200 -h -n 2>/dev/null &
 sleep 60
 false
-while mount | grep -q ${mntpoint}; do
-	umount $([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-f" || echo "") ${mntpoint} > /dev/null 2>&1
+while mount | grep -q $mntpoint; do
+	umount $([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-f" || echo "") \
+	    $mntpoint > /dev/null 2>&1
 done
 mdconfig -d -u ${mdstart}
 rm -f $D
+exit 0

Modified: user/pho/stress2/misc/quota5.sh
==============================================================================
--- user/pho/stress2/misc/quota5.sh	Tue Apr 25 08:34:39 2017	(r317400)
+++ user/pho/stress2/misc/quota5.sh	Tue Apr 25 09:08:44 2017	(r317401)
@@ -29,6 +29,7 @@
 #
 
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0
 
 mount | grep -q "on /tmp (ufs," || exit 0
 if ! grep /tmp /etc/fstab | grep -q quota ; then

Modified: user/pho/stress2/misc/quota6.sh
==============================================================================
--- user/pho/stress2/misc/quota6.sh	Tue Apr 25 08:34:39 2017	(r317400)
+++ user/pho/stress2/misc/quota6.sh	Tue Apr 25 09:08:44 2017	(r317401)
@@ -29,6 +29,7 @@
 #
 
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0
 
 . ../default.cfg
 
@@ -44,9 +45,11 @@ mdconfig -a -t vnode -f $D -u $mdstart
 bsdlabel -w md$mdstart auto
 newfs $newfs_flags  md${mdstart}$part > /dev/null
 export PATH_FSTAB=/tmp/fstab
-echo "/dev/md${mdstart}${part} ${mntpoint} ufs rw,userquota 2 2" > $PATH_FSTAB
+echo "/dev/md${mdstart}$part $mntpoint ufs rw,userquota 2 2" > \
+    $PATH_FSTAB
 mount $mntpoint
-edquota -u -f $mntpoint -e $mntpoint:850000:900000:130000:140000 root > /dev/null 2>&1
+edquota -u -f $mntpoint -e $mntpoint:850000:900000:130000:140000 root > \
+    /dev/null 2>&1
 quotaon $mntpoint
 export RUNDIR=$mntpoint/stressX
 ../testcases/rw/rw -t 10m -i 200 -h -n &
@@ -60,8 +63,9 @@ for i in `jot 5`; do
 done
 kill $pid
 wait
-while mount | grep -q ${mntpoint}; do
-	umount ${mntpoint} || sleep 1
+while mount | grep -q $mntpoint; do
+	umount $mntpoint || sleep 1
 done
 mdconfig -d -u $mdstart
 rm -f $D $PATH_FSTAB
+exit 0

Modified: user/pho/stress2/misc/quota7.sh
==============================================================================
--- user/pho/stress2/misc/quota7.sh	Tue Apr 25 08:34:39 2017	(r317400)
+++ user/pho/stress2/misc/quota7.sh	Tue Apr 25 09:08:44 2017	(r317401)
@@ -32,6 +32,7 @@
 # Causes spin in ffs_sync or panic in panic: vfs_allocate_syncvnode: insmntque failed
 
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0
 
 . ../default.cfg
 
@@ -46,7 +47,7 @@ mdconfig -a -t vnode -f $D -u $mdstart
 bsdlabel -w md$mdstart auto
 newfs $newfs_flags  md${mdstart}$part > /dev/null
 export PATH_FSTAB=/tmp/fstab
-echo "/dev/md${mdstart}${part} ${mntpoint} ufs rw,userquota 2 2" > $PATH_FSTAB
+echo "/dev/md${mdstart}${part} $mntpoint ufs rw,userquota 2 2" > $PATH_FSTAB
 mount $mntpoint
 set `df -ik $mntpoint | tail -1 | awk '{print $4,$7}'`
 export KBLOCKS=$(($1 / 21))
@@ -73,8 +74,8 @@ echo "rm -f $mntpoint/.snap/snap$i"
 rm -f $mntpoint/.snap/snap$i
 wait
 
-while mount | grep -q ${mntpoint}; do
-	umount ${mntpoint} || sleep 1
+while mount | grep -q $mntpoint; do
+	umount $mntpoint || sleep 1
 done
 mdconfig -d -u $mdstart
 rm -f $D $PATH_FSTAB

Modified: user/pho/stress2/misc/quota8.sh
==============================================================================
--- user/pho/stress2/misc/quota8.sh	Tue Apr 25 08:34:39 2017	(r317400)
+++ user/pho/stress2/misc/quota8.sh	Tue Apr 25 09:08:44 2017	(r317401)
@@ -29,9 +29,15 @@
 #
 
 # Quota / snapshot test scenario by Kris@
-# Causes spin in ffs_sync or panic in panic: vfs_allocate_syncvnode: insmntque failed
+# Causes spin in ffs_sync or panic in panic: vfs_allocate_syncvnode:
+# insmntque failed
+
+# "Fatal double fault" seen when compiling selected files
+# with "-O0" on i386:
+# https://people.freebsd.org/~pho/stress/log/quota8.txt
 
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0
 
 . ../default.cfg
 
@@ -39,15 +45,16 @@ D=$diskimage
 trap "rm -f $D" 0
 dede $D 1m 1k || exit 1
 
-mount | grep "${mntpoint}" | grep -q md${mdstart} && umount -f ${mntpoint}
-mdconfig -l | grep -q md${mdstart} &&  mdconfig -d -u ${mdstart}
+mount | grep "$mntpoint" | grep -q md$mdstart && umount -f $mntpoint
+[ -c /dev/md$mdstart ] &&  mdconfig -d -u $mdstart
 
-mdconfig -a -t vnode -f $D -u ${mdstart}
-bsdlabel -w md${mdstart} auto
-newfs $newfs_flags  md${mdstart}${part} > /dev/null
-echo "/dev/md${mdstart}${part} ${mntpoint} ufs rw,userquota 2 2" >> /etc/fstab
-mount ${mntpoint}
-set `df -ik ${mntpoint} | tail -1 | awk '{print $4,$7}'`
+mdconfig -a -t vnode -f $D -u $mdstart
+bsdlabel -w md$mdstart auto
+newfs $newfs_flags  md${mdstart}$part > /dev/null
+echo "/dev/md${mdstart}$part $mntpoint ufs rw,userquota 2 2" >> \
+    /etc/fstab
+mount $mntpoint
+set `df -ik $mntpoint | tail -1 | awk '{print $4,$7}'`
 export KBLOCKS=$(($1 / 21))
 export INODES=$(($2 / 21))
 export HOG=1
@@ -55,26 +62,30 @@ export INCARNATIONS=40
 
 export QK=$((KBLOCKS / 2))
 export QI=$((INODES / 2))
-edquota -u -f ${mntpoint} -e ${mntpoint}:$((QK - 50)):$QK:$((QI - 50 )):$QI ${testuser}
-quotaon ${mntpoint}
-sed -i -e "/md${mdstart}${part}/d" /etc/fstab
+edquota -u -f $mntpoint -e ${mntpoint}:$((QK - 50)):$QK:$((QI - 50 )):$QI \
+$testuser
+quotaon $mntpoint
+sed -i -e "/md${mdstart}$part/d" /etc/fstab
 export RUNDIR=${mntpoint}/stressX
 mkdir ${mntpoint}/stressX
 chmod 777 ${mntpoint}/stressX
-su ${testuser} -c 'sh -c "(cd ..;runRUNTIME=20m ./run.sh disk.cfg > /dev/null 2>&1)"&'   # Deadlock
+su $testuser -c 'sh -c "(cd ..;runRUNTIME=20m ./run.sh disk.cfg > \
+    /dev/null 2>&1)"&'
 for i in `jot 20`; do
-	echo "`date '+%T'` mksnap_ffs ${mntpoint} ${mntpoint}/.snap/snap$i"
-	mksnap_ffs ${mntpoint} ${mntpoint}/.snap/snap$i
+	echo "`date '+%T'` mksnap_ffs $mntpoint ${mntpoint}/.snap/snap$i"
+	mksnap_ffs $mntpoint ${mntpoint}/.snap/snap$i
 	sleep 1
 done
-i=$(($(date '+%S') % 20 + 1))
+# Remove random snapshot file
+i=$((`date +%S` % 20 + 1))
 echo "rm -f ${mntpoint}/.snap/snap$i"
 rm -f ${mntpoint}/.snap/snap$i
 wait
 
-su ${testuser} -c 'sh -c "../tools/killall.sh"'
-while mount | grep -q ${mntpoint}; do
-	umount $([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-f" || echo "") ${mntpoint} > /dev/null 2>&1
+su $testuser -c 'sh -c "../tools/killall.sh"'
+while mount | grep -q $mntpoint; do
+	umount $([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-f" || echo "") \
+	    $mntpoint > /dev/null 2>&1
 done
-mdconfig -d -u ${mdstart}
-rm -f $D
+mdconfig -d -u $mdstart
+exit 0

Modified: user/pho/stress2/misc/quota9.sh
==============================================================================
--- user/pho/stress2/misc/quota9.sh	Tue Apr 25 08:34:39 2017	(r317400)
+++ user/pho/stress2/misc/quota9.sh	Tue Apr 25 09:08:44 2017	(r317401)
@@ -43,52 +43,50 @@ qc() {
 if [ $# -eq 0 ]; then
 	trap "rm -f $D $tmp" 0
 	[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+	[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0
 
 	dede $D 1m 50 || exit 1
 
-	mount | grep "${mntpoint}" | grep -q md${mdstart} && umount -f ${mntpoint}
-	mdconfig -l | grep -q md${mdstart} &&  mdconfig -d -u ${mdstart}
-
-	mdconfig -a -t vnode -f $D -u ${mdstart}
-	bsdlabel -w md${mdstart} auto
-	newfs $newfs_flags  md${mdstart}${part} > /dev/null
-	echo "/dev/md${mdstart}${part} ${mntpoint} ufs rw,userquota 2 2" >> /etc/fstab
-	mount ${mntpoint}
+	mount | grep "$mntpoint" | grep -q md$mdstart &&
+	    umount -f $mntpoint
+	[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart
+
+	mdconfig -a -t vnode -f $D -u $mdstart
+	bsdlabel -w md$mdstart auto
+	newfs $newfs_flags  md${mdstart}$part > /dev/null
+	echo "/dev/md${mdstart}$part $mntpoint ufs rw,userquota 2 2" \
+	    >> /etc/fstab
+	mount $mntpoint
 	mkdir ${mntpoint}/stressX
 	chown $testuser ${mntpoint}/stressX
-	set `df -ik ${mntpoint} | tail -1 | awk '{print $4,$7}'`
+	set `df -ik $mntpoint | tail -1 | awk '{print $4,$7}'`
 	export KBLOCKS=$1
 	export INODES=$2
 
 	export QK=$((KBLOCKS / 2))
 	export QI=$((INODES / 2))
-	edquota -u -f ${mntpoint} -e ${mntpoint}:$((QK - 50)):$QK:$((QI - 50 )):$QI ${testuser} > /dev/null 2>&1
-	quotaon ${mntpoint}
+	edquota -u -f $mntpoint -e \
+	    ${mntpoint}:$((QK - 50)):$QK:$((QI - 50 )):$QI $testuser > \
+	    /dev/null 2>&1
+	quotaon $mntpoint
 
-#	quotaoff ${mntpoint};umount ${mntpoint}; mount ${mntpoint};quotaon ${mntpoint}
-#	df -i ${mntpoint}
-#	repquota   -v ${mntpoint}
-	qc            ${mntpoint}
-#	repquota   -v ${mntpoint}
-#	echo "- Start test -"
+	qc $mntpoint
 
 	su ${testuser} $0 xxx
 	du -k /mnt/stressX
 
-#	quotaoff ${mntpoint};umount ${mntpoint}; mount ${mntpoint};quotaon ${mntpoint}
-#	df -i ${mntpoint}
-#	repquota   -v ${mntpoint}
-	qc            ${mntpoint}
-#	repquota   -v ${mntpoint}
+	qc $mntpoint
 
 	sed -i -e "/md${mdstart}${part}/d" /etc/fstab
-	while mount | grep -q ${mntpoint}; do
-		umount $([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-f" || echo "") ${mntpoint} > /dev/null 2>&1
+	while mount | grep -q $mntpoint; do
+		umount $([ $((`date '+%s'` % 2)) -eq 0 ] &&
+		    echo "-f" || echo "") $mntpoint > /dev/null 2>&1
 	done
-	mdconfig -d -u ${mdstart}
+	mdconfig -d -u $mdstart
 	rm -f $D
 else
 	for i in `jot 20`; do
-		dede ${mntpoint}/stressX/d$i 1m 1
+		dede $mntpoint/stressX/d$i 1m 1
 	done
 fi
+exit 0

Modified: user/pho/stress2/misc/suj18.sh
==============================================================================
--- user/pho/stress2/misc/suj18.sh	Tue Apr 25 08:34:39 2017	(r317400)
+++ user/pho/stress2/misc/suj18.sh	Tue Apr 25 09:08:44 2017	(r317401)
@@ -36,31 +36,35 @@
 # Fixed by r305594.
 
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0
 
 . ../default.cfg
 
-mount | grep "${mntpoint}" | grep -q md${mdstart} && umount ${mntpoint}
-mdconfig -l | grep -q md${mdstart} &&  mdconfig -d -u ${mdstart}
+mount | grep "$mntpoint" | grep -q md$mdstart && umount $mntpoint
+mdconfig -l | grep -q md$mdstart &&  mdconfig -d -u $mdstart
 
 mdconfig -a -t swap -s 1g -u ${mdstart}
-bsdlabel -w md${mdstart} auto
-newfs -j  md${mdstart}${part} > /dev/null
+bsdlabel -w md$mdstart auto
+newfs -j  md${mdstart}$part > /dev/null
 export PATH_FSTAB=/tmp/fstab
-echo "/dev/md${mdstart}${part} ${mntpoint} ufs rw,userquota 2 2" > $PATH_FSTAB
-mount ${mntpoint}
-set `df -ik ${mntpoint} | tail -1 | awk '{print $4,$7}'`
+echo "/dev/md${mdstart}$part $mntpoint ufs rw,userquota 2 2" > \
+    $PATH_FSTAB
+mount $mntpoint
+set `df -ik $mntpoint | tail -1 | awk '{print $4,$7}'`
 export QK=$(($1 / 10 * 8))
 export QI=$(($2 / 10 * 8))
-edquota -u -f ${mntpoint} -e ${mntpoint}:$((QK - 50)):$QK:$((QI - 50 )):$QI ${testuser}
-quotaon ${mntpoint}
+edquota -u -f $mntpoint -e ${mntpoint}:$((QK - 50)):$QK:$((QI - 50 )):$QI \
+    $testuser
+quotaon $mntpoint
 export RUNDIR=${mntpoint}/stressX
-chmod 777 ${mntpoint}
-su ${testuser} -c 'sh -c "(cd ..;runRUNTIME=20m ./run.sh disk.cfg > /dev/null 2>&1)"'
+chmod 777 $mntpoint
+su $testuser -c 'sh -c "(cd ..;runRUNTIME=20m ./run.sh disk.cfg > \
+    /dev/null 2>&1)"'
 
 rm -f $PATH_FSTAB
 for i in `jot 6`; do
 	umount $mntpoint && break || sleep 10
 done
 [ $i -eq 6 ] && exit 1
-mdconfig -d -u ${mdstart}
+mdconfig -d -u $mdstart
 exit 0

Modified: user/pho/stress2/misc/suj19.sh
==============================================================================
--- user/pho/stress2/misc/suj19.sh	Tue Apr 25 08:34:39 2017	(r317400)
+++ user/pho/stress2/misc/suj19.sh	Tue Apr 25 09:08:44 2017	(r317401)
@@ -31,6 +31,7 @@
 # SUJ, quota and snapshots test scenario
 
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0
 
 . ../default.cfg
 

From owner-svn-src-user@freebsd.org  Thu Apr 27 07:42:39 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79818D524F4
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Thu, 27 Apr 2017 07:42:39 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4AC10FCB;
 Thu, 27 Apr 2017 07:42:39 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3R7gc5E037055;
 Thu, 27 Apr 2017 07:42:38 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3R7gclN037054;
 Thu, 27 Apr 2017 07:42:38 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704270742.v3R7gclN037054@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Thu, 27 Apr 2017 07:42:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317490 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Apr 2017 07:42:39 -0000

Author: pho
Date: Thu Apr 27 07:42:38 2017
New Revision: 317490
URL: https://svnweb.freebsd.org/changeset/base/317490

Log:
  Style fix.
  
  Sponsored by:	Dell EMC Isilon

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

Modified: user/pho/stress2/misc/vmio.sh
==============================================================================
--- user/pho/stress2/misc/vmio.sh	Thu Apr 27 07:32:07 2017	(r317489)
+++ user/pho/stress2/misc/vmio.sh	Thu Apr 27 07:42:38 2017	(r317490)
@@ -49,10 +49,11 @@ need=$((size * 2))
 d1=${diskimage}.1
 d2=${diskimage}.2
 rm -f $d1 $d2 || exit 1
-[ `df -k $(dirname $diskimage) | tail -1 | awk '{print int($4 / 1024)'}` -lt \
-    $need ] && printf "Need %d MB on %s.\n" $need `dirname $diskimage` && exit
+[ `df -k $(dirname $diskimage) | tail -1 | awk '{print int($4 / 1024)'}` \
+    -lt $need ] &&
+    printf "Need %d MB on %s.\n" $need `dirname $diskimage` && exit 0
 trap "rm -f $d1 $d2" EXIT INT
 dd if=/dev/zero of=$d1 bs=1m count=$size 2>&1 | \
     egrep -v "records|transferred"
 cp $d1 $d2
-[ -n "$off" ] && swapon -a
+[ $off ] && swapon -a

From owner-svn-src-user@freebsd.org  Thu Apr 27 07:44:49 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08B19D52648
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Thu, 27 Apr 2017 07:44:49 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CF6E1118D;
 Thu, 27 Apr 2017 07:44:48 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3R7ilZe037183;
 Thu, 27 Apr 2017 07:44:47 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3R7ilWM037182;
 Thu, 27 Apr 2017 07:44:47 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704270744.v3R7ilWM037182@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Thu, 27 Apr 2017 07:44:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317491 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Apr 2017 07:44:49 -0000

Author: pho
Date: Thu Apr 27 07:44:47 2017
New Revision: 317491
URL: https://svnweb.freebsd.org/changeset/base/317491

Log:
  Style fixes.
  
  Sponsored by:	Dell EMC Isilon

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

Modified: user/pho/stress2/misc/md.sh
==============================================================================
--- user/pho/stress2/misc/md.sh	Thu Apr 27 07:42:38 2017	(r317490)
+++ user/pho/stress2/misc/md.sh	Thu Apr 27 07:44:47 2017	(r317491)
@@ -35,13 +35,13 @@
 
 . ../default.cfg
 
-mount | grep "${mntpoint}" | grep md${mdstart}${part} > /dev/null && umount ${mntpoint}
-mdconfig -l | grep md${mdstart} > /dev/null &&  mdconfig -d -u ${mdstart}
+mount | grep "$mntpoint" | grep md${mdstart}${part} > /dev/null && umount $mntpoint
+[ -c /dev/md$mdstart ] &&  mdconfig -d -u $mdstart
 
-mdconfig -a -t swap -s 2m -u ${mdstart}
+mdconfig -a -t swap -s 2m -u $mdstart
 bsdlabel -w md${mdstart} auto
 newfs md${mdstart}${part} > /dev/null
-mount /dev/md${mdstart}${part} ${mntpoint}
+mount /dev/md${mdstart}$part $mntpoint
 
 export RUNDIR=${mntpoint}/stressX
 export KBLOCKS=30000		# Exaggerate disk capacity
@@ -51,8 +51,10 @@ for i in `jot 20`; do
    (cd ../testcases/rw;./rw -t 2m -i 20 > /dev/null 2>&1)
 done
 
-while mount | grep -q ${mntpoint}; do
-   umount $([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-f" || echo "") ${mntpoint} > /dev/null 2>&1
+while mount | grep -q $mntpoint; do
+	umount $([ $((`date '+%s'` % 2)) -eq 0 ] &&
+	    echo "-f" || echo "") $mntpoint > /dev/null 2>&1
 done
 
-mdconfig -d -u ${mdstart}
+mdconfig -d -u $mdstart
+exit 0

From owner-svn-src-user@freebsd.org  Thu Apr 27 07:49:35 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E179D52A25
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Thu, 27 Apr 2017 07:49:35 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2893C162F;
 Thu, 27 Apr 2017 07:49:35 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3R7nYBV037505;
 Thu, 27 Apr 2017 07:49:34 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3R7nXDj037498;
 Thu, 27 Apr 2017 07:49:33 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704270749.v3R7nXDj037498@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Thu, 27 Apr 2017 07:49:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317492 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Apr 2017 07:49:35 -0000

Author: pho
Date: Thu Apr 27 07:49:33 2017
New Revision: 317492
URL: https://svnweb.freebsd.org/changeset/base/317492

Log:
  If "gnop status" fail, return 1.
  
  Sponsored by:	Dell EMC Isilon

Modified:
  user/pho/stress2/misc/gnop.sh
  user/pho/stress2/misc/gnop2.sh
  user/pho/stress2/misc/gnop3.sh
  user/pho/stress2/misc/gnop4.sh
  user/pho/stress2/misc/graid1_5.sh
  user/pho/stress2/misc/graid1_7.sh
  user/pho/stress2/misc/suj12.sh

Modified: user/pho/stress2/misc/gnop.sh
==============================================================================
--- user/pho/stress2/misc/gnop.sh	Thu Apr 27 07:44:47 2017	(r317491)
+++ user/pho/stress2/misc/gnop.sh	Thu Apr 27 07:49:33 2017	(r317492)
@@ -61,7 +61,7 @@ test() {
 
 kldstat | grep -q geom_nop || { gnop load 2>/dev/null || exit 0 &&
     notloaded=1; }
-gnop status || exit
+gnop status || exit 1
 
 for i in 1k 2k 4k 8k; do
 	test $i

Modified: user/pho/stress2/misc/gnop2.sh
==============================================================================
--- user/pho/stress2/misc/gnop2.sh	Thu Apr 27 07:44:47 2017	(r317491)
+++ user/pho/stress2/misc/gnop2.sh	Thu Apr 27 07:49:33 2017	(r317492)
@@ -70,7 +70,7 @@ test() {
 	mdconfig -d -u $mdstart
 }
 
-gnop status || exit
+gnop status || exit 1
 
 for i in 1k 2k 4k 8k; do
 	test $i

Modified: user/pho/stress2/misc/gnop3.sh
==============================================================================
--- user/pho/stress2/misc/gnop3.sh	Thu Apr 27 07:44:47 2017	(r317491)
+++ user/pho/stress2/misc/gnop3.sh	Thu Apr 27 07:49:33 2017	(r317492)
@@ -39,7 +39,7 @@
 
 kldstat | grep -q geom_nop || { gnop load 2>/dev/null || exit 0 &&
     notloaded=1; }
-gnop status || exit
+gnop status || exit 1
 
 mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint
 [ -c /dev/md$mdstart ] &&  mdconfig -d -u $mdstart

Modified: user/pho/stress2/misc/gnop4.sh
==============================================================================
--- user/pho/stress2/misc/gnop4.sh	Thu Apr 27 07:44:47 2017	(r317491)
+++ user/pho/stress2/misc/gnop4.sh	Thu Apr 27 07:49:33 2017	(r317492)
@@ -40,7 +40,7 @@ gigs=9
 
 kldstat | grep -q geom_nop || { gnop load 2>/dev/null || exit 0 &&
     notloaded=1; }
-gnop status || exit
+gnop status || exit 1
 
 mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint
 [ -c /dev/md$mdstart ] &&  mdconfig -d -u $mdstart

Modified: user/pho/stress2/misc/graid1_5.sh
==============================================================================
--- user/pho/stress2/misc/graid1_5.sh	Thu Apr 27 07:44:47 2017	(r317491)
+++ user/pho/stress2/misc/graid1_5.sh	Thu Apr 27 07:49:33 2017	(r317492)
@@ -42,7 +42,7 @@ old=`sysctl -n kern.geom.mirror.debug`
 sysctl kern.geom.mirror.debug=-1 | grep -q -- -1 ||
 	sysctl kern.geom.mirror.debug=$old > /dev/null
 kldstat | grep -q geom_nop || { gnop load 2>/dev/null || exit 0; }
-gnop status || exit 0
+gnop status || exit 1
 
 u1=$mdstart
 u2=$((mdstart + 1))

Modified: user/pho/stress2/misc/graid1_7.sh
==============================================================================
--- user/pho/stress2/misc/graid1_7.sh	Thu Apr 27 07:44:47 2017	(r317491)
+++ user/pho/stress2/misc/graid1_7.sh	Thu Apr 27 07:49:33 2017	(r317492)
@@ -42,7 +42,7 @@ old=`sysctl -n kern.geom.mirror.debug`
 sysctl kern.geom.mirror.debug=-1 | grep -q -- -1 ||
     sysctl kern.geom.mirror.debug=$old > /dev/null
 kldstat | grep -q geom_nop || { gnop load 2>/dev/null || exit 0; }
-gnop status || exit 0
+gnop status || exit 1
 
 u1=$mdstart
 s=0

Modified: user/pho/stress2/misc/suj12.sh
==============================================================================
--- user/pho/stress2/misc/suj12.sh	Thu Apr 27 07:44:47 2017	(r317491)
+++ user/pho/stress2/misc/suj12.sh	Thu Apr 27 07:49:33 2017	(r317492)
@@ -34,11 +34,12 @@
 
 . ../default.cfg
 
+gnop load || exit 0
 mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint
 mdconfig -l | grep -q md$mdstart &&  mdconfig -d -u $mdstart
 
 mdconfig -a -t swap -s 1g -u $mdstart || exit 1
-gnop load
+gnop status || exit 1
 gnop create -S 4k /dev/md$mdstart
 newfs -j /dev/md${mdstart}.nop
 mount /dev/md${mdstart}.nop $mntpoint

From owner-svn-src-user@freebsd.org  Thu Apr 27 07:51:38 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 910C9D52C32
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Thu, 27 Apr 2017 07:51:38 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5EC10180C;
 Thu, 27 Apr 2017 07:51:38 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3R7pbAE037639;
 Thu, 27 Apr 2017 07:51:37 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3R7pbc3037638;
 Thu, 27 Apr 2017 07:51:37 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704270751.v3R7pbc3037638@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Thu, 27 Apr 2017 07:51:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317493 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Apr 2017 07:51:38 -0000

Author: pho
Date: Thu Apr 27 07:51:37 2017
New Revision: 317493
URL: https://svnweb.freebsd.org/changeset/base/317493

Log:
  Fix broken pthread error reporting and extend timeout.
  
  Sponsored by:	Dell EMC Isilon

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

Modified: user/pho/stress2/misc/namecache2.sh
==============================================================================
--- user/pho/stress2/misc/namecache2.sh	Thu Apr 27 07:49:33 2017	(r317492)
+++ user/pho/stress2/misc/namecache2.sh	Thu Apr 27 07:51:37 2017	(r317493)
@@ -151,7 +151,7 @@ main(void)
 	}
 	result = pthread_create(&threadId, NULL, statThread, NULL);
 	if (result < 0)
-		err(1, "pthread_create(): %s\n", strerror(result));
+		errc(1, result, "pthread_create()");
 
 	start = time(NULL);
 	for (number = 0; number < 0x001FFFFF; number += 2) {
@@ -183,7 +183,7 @@ main(void)
 			nanosleep(&period, 0);
 			return 0;
 		}
-		if (time(NULL) - start > 600) {
+		if (time(NULL) - start > 1800) {
 			fprintf(stderr, "Test timed out.\n");
 			break;
 		}

From owner-svn-src-user@freebsd.org  Thu Apr 27 07:53:54 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 567A9D52C93
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Thu, 27 Apr 2017 07:53:54 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2748F1B00;
 Thu, 27 Apr 2017 07:53:54 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3R7rrLH041344;
 Thu, 27 Apr 2017 07:53:53 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3R7rrsn041343;
 Thu, 27 Apr 2017 07:53:53 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704270753.v3R7rrsn041343@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Thu, 27 Apr 2017 07:53:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317494 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Apr 2017 07:53:54 -0000

Author: pho
Date: Thu Apr 27 07:53:52 2017
New Revision: 317494
URL: https://svnweb.freebsd.org/changeset/base/317494

Log:
  Return error status.
  
  Sponsored by:	Dell EMC Isilon

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

Modified: user/pho/stress2/misc/mmap13.sh
==============================================================================
--- user/pho/stress2/misc/mmap13.sh	Thu Apr 27 07:51:37 2017	(r317493)
+++ user/pho/stress2/misc/mmap13.sh	Thu Apr 27 07:53:52 2017	(r317494)
@@ -50,11 +50,12 @@ for i in `jot 5000`; do
 	/tmp/mmap13
 done
 v2=`sysctl -n vm.stats.vm.v_wire_count`
+s=0
 [ $v2 -gt $((v1 + 500)) ] &&
-    echo "FAIL vm.stats.vm.v_wire_count changed from $v1 to $v2."
+{ s=1; echo "vm.stats.vm.v_wire_count changed from $v1 to $v2."; }
 
 rm -f /tmp/mmap13
-exit
+exit $s
 
 EOF
 #include <sys/mman.h>

From owner-svn-src-user@freebsd.org  Thu Apr 27 08:16:53 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D2F8D52D7A
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Thu, 27 Apr 2017 08:16:53 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2DA34E13;
 Thu, 27 Apr 2017 08:16:53 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3R8GqZf050216;
 Thu, 27 Apr 2017 08:16:52 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3R8GqkF050215;
 Thu, 27 Apr 2017 08:16:52 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704270816.v3R8GqkF050215@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Thu, 27 Apr 2017 08:16:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317495 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Apr 2017 08:16:53 -0000

Author: pho
Date: Thu Apr 27 08:16:51 2017
New Revision: 317495
URL: https://svnweb.freebsd.org/changeset/base/317495

Log:
  Return error status.
  
  Sponsored by:	Dell EMC Isilon

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

Modified: user/pho/stress2/misc/mmap20.sh
==============================================================================
--- user/pho/stress2/misc/mmap20.sh	Thu Apr 27 07:53:52 2017	(r317494)
+++ user/pho/stress2/misc/mmap20.sh	Thu Apr 27 08:16:51 2017	(r317495)
@@ -46,9 +46,10 @@ rm -f mmap20.c
 cd $odir
 
 /tmp/mmap20
+s=$?
 
 rm -f /tmp/mmap20
-exit
+exit $s
 
 EOF
 #include <sys/types.h>

From owner-svn-src-user@freebsd.org  Thu Apr 27 11:19:57 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D39A2D53AED
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Thu, 27 Apr 2017 11:19:57 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A6397679;
 Thu, 27 Apr 2017 11:19:57 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3RBJuWt023124;
 Thu, 27 Apr 2017 11:19:56 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3RBJu65023123;
 Thu, 27 Apr 2017 11:19:56 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704271119.v3RBJu65023123@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Thu, 27 Apr 2017 11:19:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317496 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Apr 2017 11:19:57 -0000

Author: pho
Date: Thu Apr 27 11:19:56 2017
New Revision: 317496
URL: https://svnweb.freebsd.org/changeset/base/317496

Log:
  The options flag must be set to either FTS_LOGICAL or FTS_PHYSICAL.
  
  Sponsored by:	Dell EMC Isilon

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

Modified: user/pho/stress2/misc/fifo3.sh
==============================================================================
--- user/pho/stress2/misc/fifo3.sh	Thu Apr 27 08:16:51 2017	(r317495)
+++ user/pho/stress2/misc/fifo3.sh	Thu Apr 27 11:19:56 2017	(r317496)
@@ -145,7 +145,7 @@ test(void)
 	if (fork() == 0)
 		tmkdir();
 
-	ftsoptions = 0;
+	ftsoptions = FTS_PHYSICAL;
 	args[0] = ".";
 	args[1] = 0;
 

From owner-svn-src-user@freebsd.org  Thu Apr 27 11:22:14 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75D92D53DCF
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Thu, 27 Apr 2017 11:22:14 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 46B6DA8E;
 Thu, 27 Apr 2017 11:22:14 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3RBMDd7024673;
 Thu, 27 Apr 2017 11:22:13 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3RBMDXK024672;
 Thu, 27 Apr 2017 11:22:13 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704271122.v3RBMDXK024672@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Thu, 27 Apr 2017 11:22:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317497 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Apr 2017 11:22:14 -0000

Author: pho
Date: Thu Apr 27 11:22:13 2017
New Revision: 317497
URL: https://svnweb.freebsd.org/changeset/base/317497

Log:
  Ensure that open(2) and mmap(2) flags are in sync.
  
  Sponsored by:	Dell EMC Isilon

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

Modified: user/pho/stress2/misc/rdwr.sh
==============================================================================
--- user/pho/stress2/misc/rdwr.sh	Thu Apr 27 11:19:56 2017	(r317496)
+++ user/pho/stress2/misc/rdwr.sh	Thu Apr 27 11:22:13 2017	(r317497)
@@ -75,7 +75,7 @@ main(int argc, char **argv)
 	if ((fd1 = open("/dev/null", O_RDWR, 0)) == -1)
 		err(1, "open /dev/null");
 
-	if ((fd2 = open("/dev/zero", O_RDONLY)) == -1)
+	if ((fd2 = open("/dev/zero", O_RDWR)) == -1)
 		err(1, "open /dev/zero");
 
 	if (sizeof(size_t) == sizeof(int32_t))

From owner-svn-src-user@freebsd.org  Thu Apr 27 11:25:59 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D31BD53EA0
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Thu, 27 Apr 2017 11:25:59 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F3EDFC19;
 Thu, 27 Apr 2017 11:25:58 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3RBPwsS026925;
 Thu, 27 Apr 2017 11:25:58 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3RBPwHd026924;
 Thu, 27 Apr 2017 11:25:58 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704271125.v3RBPwHd026924@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Thu, 27 Apr 2017 11:25:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317498 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Apr 2017 11:25:59 -0000

Author: pho
Date: Thu Apr 27 11:25:57 2017
New Revision: 317498
URL: https://svnweb.freebsd.org/changeset/base/317498

Log:
  Remove unneeded "/" from path names.
  
  Sponsored by:	Dell EMC Isilon

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

Modified: user/pho/stress2/misc/tmpfs4.sh
==============================================================================
--- user/pho/stress2/misc/tmpfs4.sh	Thu Apr 27 11:22:13 2017	(r317497)
+++ user/pho/stress2/misc/tmpfs4.sh	Thu Apr 27 11:25:57 2017	(r317498)
@@ -38,9 +38,9 @@ mount | grep "$mntpoint" | grep -q tmpfs
 mount -t tmpfs tmpfs  $mntpoint
 
 for i in `jot 100`; do
-	mkdir -p /${mntpoint}/1/2
-	cd /${mntpoint}/1/2
-	rm -rf /${mntpoint}/1
+	mkdir -p ${mntpoint}/1/2
+	cd ${mntpoint}/1/2
+	rm -rf ${mntpoint}/1
 	cd .. 2>&1 | grep -v "cd: \.\.: No such file or directory"
 done
 

From owner-svn-src-user@freebsd.org  Fri Apr 28 12:05:08 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E22AD547A8
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Fri, 28 Apr 2017 12:05:08 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 408E61832;
 Fri, 28 Apr 2017 12:05:08 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3SC57Qr034058;
 Fri, 28 Apr 2017 12:05:07 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3SC57el034055;
 Fri, 28 Apr 2017 12:05:07 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704281205.v3SC57el034055@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Fri, 28 Apr 2017 12:05:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317548 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 28 Apr 2017 12:05:08 -0000

Author: pho
Date: Fri Apr 28 12:05:06 2017
New Revision: 317548
URL: https://svnweb.freebsd.org/changeset/base/317548

Log:
  Do not hard code mount points.
  
  Sponsored by:	Dell EMC Isilon

Modified:
  user/pho/stress2/misc/nullfs10.sh
  user/pho/stress2/misc/nullfs11.sh
  user/pho/stress2/misc/nullfs9.sh

Modified: user/pho/stress2/misc/nullfs10.sh
==============================================================================
--- user/pho/stress2/misc/nullfs10.sh	Fri Apr 28 11:00:58 2017	(r317547)
+++ user/pho/stress2/misc/nullfs10.sh	Fri Apr 28 12:05:06 2017	(r317548)
@@ -40,7 +40,7 @@
 
 . ../default.cfg
 
-mnt2=/mnt2
+mnt2=${mntpoint}2
 mount | grep -q $mnt2 && umount $mnt2
 
 [ -d $mnt2 ] || mkdir $mnt2
@@ -61,6 +61,7 @@ sleep .5
 # This line should cause a "/mnt2/ls: Text file busy"
 $mnt2/ls -l /bin/ls $mntpoint $mnt2 && echo FAIL || echo OK
 kill $!
+wait
 
 while mount | grep -q "$mnt2 "; do
 	umount $mnt2 || sleep 1

Modified: user/pho/stress2/misc/nullfs11.sh
==============================================================================
--- user/pho/stress2/misc/nullfs11.sh	Fri Apr 28 11:00:58 2017	(r317547)
+++ user/pho/stress2/misc/nullfs11.sh	Fri Apr 28 12:05:06 2017	(r317548)
@@ -43,8 +43,8 @@ fi
 export LANG=C
 CACHE=nullfs11-cache.log
 NOCACHE=nullfs11-nocache.log
-mp1=/mnt
-mp2=/mnt2
+mp1=$mntpoint
+mp2=${mntpoint}2
 [ -d $mp2 ] || mkdir $mp2
 rm -f $CACHE $NOCACHE
 

Modified: user/pho/stress2/misc/nullfs9.sh
==============================================================================
--- user/pho/stress2/misc/nullfs9.sh	Fri Apr 28 11:00:58 2017	(r317547)
+++ user/pho/stress2/misc/nullfs9.sh	Fri Apr 28 12:05:06 2017	(r317548)
@@ -36,7 +36,7 @@
 
 . ../default.cfg
 
-mnt2=/mnt2
+mnt2=${mntpoint}2
 mount | grep -q $mnt2/mp && umount $mnt2/mp
 
 [ -d $mnt2 ] || mkdir $mnt2

From owner-svn-src-user@freebsd.org  Fri Apr 28 12:07:24 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0745D547F5
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Fri, 28 Apr 2017 12:07:24 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CB48D194F;
 Fri, 28 Apr 2017 12:07:24 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3SC7N2Z034172;
 Fri, 28 Apr 2017 12:07:23 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3SC7NG1034170;
 Fri, 28 Apr 2017 12:07:23 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704281207.v3SC7NG1034170@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Fri, 28 Apr 2017 12:07:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317549 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 28 Apr 2017 12:07:25 -0000

Author: pho
Date: Fri Apr 28 12:07:23 2017
New Revision: 317549
URL: https://svnweb.freebsd.org/changeset/base/317549

Log:
  Added two new nullfs test scenarios.
  
  Sponsored by:	Dell EMC Isilon

Added:
  user/pho/stress2/misc/nullfs21.sh   (contents, props changed)
  user/pho/stress2/misc/nullfs22.sh   (contents, props changed)

Added: user/pho/stress2/misc/nullfs21.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/pho/stress2/misc/nullfs21.sh	Fri Apr 28 12:07:23 2017	(r317549)
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2016 EMC Corp.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+
+# mv <nullfs src> <origin src> removes the file. This is OK on FreeBSD.
+# This is handled on Linux with "mount --bind".
+
+. ../default.cfg
+
+mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint
+mdconfig -l | grep -q md$mdstart &&  mdconfig -d -u $mdstart
+
+mdconfig -a -t swap -s 512m -u $mdstart || exit 1
+bsdlabel -w md$mdstart auto
+
+newfs -n -b 4096 -f 512 -i 1024 md${mdstart}$part > /dev/null
+
+mount /dev/md${mdstart}$part $mntpoint
+
+mp2=${mntpoint}2
+[ -d $mp2 ] || mkdir -p $mp2
+mount | grep -wq $mp2 && umount $mp2
+mount -t nullfs $mntpoint $mp2
+
+touch $mntpoint/file
+
+# mv's rename(2) fails as this is a "cross mount" ->
+# rm dst; cp src dst; rm src
+
+mv $mp2/file $mountpoint/file
+[ -f $mntpoint/file ] ||
+    { ls -ali $mntpoint $mp2; status=0; }
+#    { echo FAIL; ls -ali $mntpoint $mp2; status=1; }
+
+while mount | grep $mp2 | grep -q nullfs; do
+	umount $mp2 || sleep 1
+done
+n=0
+while mount | grep $mntpoint | grep -q /dev/md; do
+	umount $mntpoint || sleep 1
+	n=$((n + 1))
+	[ $n -gt 30 ] && { echo FAIL; status=2; }
+done
+mdconfig -d -u $mdstart
+exit $status

Added: user/pho/stress2/misc/nullfs22.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/pho/stress2/misc/nullfs22.sh	Fri Apr 28 12:07:23 2017	(r317549)
@@ -0,0 +1,249 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2016 EMC Corp.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+# fcntl(2) locking scenario, using UFS and a nullfs mount.
+# No problems seen.
+
+[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+
+. ../default.cfg
+
+here=`pwd`
+cd /tmp
+sed '1,/^EOF/d' < $here/$0 > nullfs22.c
+mycc -o nullfs22 -Wall -Wextra -O0 -g nullfs22.c || exit 1
+rm -f nullfs22.c
+
+mp2=${mntpoint}2
+[ -d $mp2 ] || mkdir -p $mp2
+mount | grep -q "on $mp2 " && umount $mp2
+mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint
+[ -c /dev/md$mdstart ] &&  mdconfig -d -u $mdstart
+mdconfig -a -t swap -s 512m -u $mdstart || exit 1
+bsdlabel -w md$mdstart auto
+newfs -n md${mdstart}$part > /dev/null
+mount /dev/md${mdstart}$part $mntpoint
+
+mount -t nullfs $mntpoint $mp2
+
+/tmp/nullfs22 $mntpoint $mp2
+status=$?
+
+while mount | grep -q "on $mp2 "; do
+	umount $mp2
+done
+while mount | grep "on $mntpoint " | grep -q /dev/md; do
+	umount $mntpoint || sleep 1
+done
+mdconfig -d -u $mdstart
+rm -f /tmp/nullfs22
+exit $status
+EOF
+#include <sys/param.h>
+#include <sys/mman.h>
+#include <sys/wait.h>
+
+#include <machine/atomic.h>
+
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#define LOOPS 1024
+#define N (512)
+#define PARALLEL 4
+
+#define DONE 1
+#define SYNC 0
+
+int fd;
+volatile u_int *share;
+char name1[80], name2[80];
+
+static void
+ahandler(int s __unused)
+{
+	fprintf(stderr, "In alarm handler\n");
+	unlink(name1);
+	_exit(1);
+}
+
+void
+add(int n, int increment)
+{
+        struct flock fl;
+	off_t pos;
+	long val, oval;
+	int r;
+
+	pos = n * sizeof(val);
+	memset(&fl, 0, sizeof(fl));
+        fl.l_start = pos;
+        fl.l_len = sizeof(val);
+        fl.l_type = F_WRLCK;
+        fl.l_whence = SEEK_SET;
+
+	while (fcntl(fd, F_SETLKW, &fl) < 0) {
+		if (errno != EAGAIN)
+			err(1, "F_SETLKW (child)");
+		usleep(100);
+	}
+
+	if (lseek(fd, pos, SEEK_SET) == -1)
+		err(1, "lseek");
+	oval = 999999;
+	while ((r = read(fd, &val, sizeof(val)) != sizeof(val))) {
+		if (r == -1 && errno != EAGAIN)
+			err(1, "read");
+		if (lseek(fd, pos, SEEK_SET) == -1)
+			err(1, "lseek");
+	}
+	oval = val;
+	val = val + increment;
+#if defined(DEBUG)
+	fprintf(stderr, "add(%d, %d) @ pos %ld: %ld = %ld + %d\n",
+	    n, increment, (long)pos, val, oval, increment);
+#endif
+	if (lseek(fd, pos, SEEK_SET) == -1)
+		err(1, "lseek");
+	while ((r = write(fd, &val, sizeof(val)) != sizeof(val))) {
+		if (r == -1 && errno != EAGAIN)
+			err(1, "write");
+		if (lseek(fd, pos, SEEK_SET) == -1)
+			err(1, "lseek");
+	}
+
+        fl.l_type = F_UNLCK;
+        if (fcntl(fd, F_SETLK, &fl) < 0)
+                err(1, "F_UNLCK");
+
+}
+
+void
+count(int val)
+{
+	int i, j;
+	char help[80], *name;
+
+	if (val == 1)
+		name = name1;
+	else
+		name = name2;
+	snprintf(help, sizeof(help), "%s %d %s", __func__, val, name);
+	setproctitle("%s", help);
+	atomic_add_int(&share[SYNC], 1);
+	while (share[SYNC] != 2 * PARALLEL)
+		;
+
+	/* Need to re-open after a fork() */
+	close(fd);
+	if ((fd = open(name, O_RDWR)) == -1)
+		err(1, "open(%s)", name);
+
+	for (i = 0; i < LOOPS; i++) {
+		for (j = 0; j < N; j++)
+			add(j, val);
+	}
+
+	atomic_add_int(&share[DONE], 1);
+
+	_exit(0);
+}
+
+int
+main(int argc, char *argv[])
+{
+	off_t len;
+	size_t mlen;
+	long val, sum;
+	int i, s, stat;
+
+	if (argc != 3) {
+		fprintf(stderr, "Usage: %s <dir1> <dir2>\n", argv[0]);
+		exit(1);
+	}
+
+	mlen = PAGE_SIZE;
+	if ((share = mmap(NULL, mlen, PROT_READ | PROT_WRITE,
+	    MAP_ANON | MAP_SHARED, -1, 0)) == MAP_FAILED)
+		err(1, "mmap");
+	snprintf(name1, sizeof(name1), "%s/work", argv[1]);
+	snprintf(name2, sizeof(name2), "%s/work", argv[2]);
+	signal(SIGALRM, ahandler);
+	alarm(300);
+	if ((fd = open(name1, O_RDWR | O_CREAT | O_TRUNC, 0640)) == -1)
+		err(1, "open(%s)", name1);
+	len = N * sizeof(val);
+	if (ftruncate(fd, len) == -1)
+		err(1, "ftruncate");
+
+	for (i = 0; i < PARALLEL; i++) {
+		if (fork() == 0)
+			count(1);
+	}
+	for (i = 0; i < PARALLEL; i++) {
+		if (fork() == 0)
+			count(-1);
+	}
+
+	while (share[DONE] != 2 * PARALLEL)
+		usleep(10000);
+
+	if (lseek(fd, 0, SEEK_SET) == -1)
+		err(1, "lseek");
+	sum = 0;
+	for (i = 0; i < N; i++) {
+		if (read(fd, &val, sizeof(val)) != sizeof(val))
+			err(1, "Final read");
+		if (val != 0)
+			fprintf(stderr, "index %d: %ld\n", i, val);
+		sum += val;
+	}
+	if (sum != 0)
+		fprintf(stderr, "FAIL\n");
+	unlink(name1);
+
+	s = 0;
+	for (i = 0; i < PARALLEL; i++) {
+		wait(&stat);
+		s += WEXITSTATUS(stat);
+		wait(&stat);
+		s += WEXITSTATUS(stat);
+	}
+
+	close(fd);
+
+	return (sum != 0 || s != 0);
+}

From owner-svn-src-user@freebsd.org  Fri Apr 28 12:10:17 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB7CD54872
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Fri, 28 Apr 2017 12:10:17 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 67CC21AAC;
 Fri, 28 Apr 2017 12:10:17 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3SCAG6T034335;
 Fri, 28 Apr 2017 12:10:16 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3SCAGnU034334;
 Fri, 28 Apr 2017 12:10:16 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704281210.v3SCAGnU034334@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Fri, 28 Apr 2017 12:10:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317550 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 28 Apr 2017 12:10:17 -0000

Author: pho
Date: Fri Apr 28 12:10:16 2017
New Revision: 317550
URL: https://svnweb.freebsd.org/changeset/base/317550

Log:
  Do not use hardcoded mount points.
  
  Sponsored by:	Dell EMC Isilon

Modified:
  user/pho/stress2/misc/nullfs6.sh
  user/pho/stress2/misc/nullfs8.sh

Modified: user/pho/stress2/misc/nullfs6.sh
==============================================================================
--- user/pho/stress2/misc/nullfs6.sh	Fri Apr 28 12:07:23 2017	(r317549)
+++ user/pho/stress2/misc/nullfs6.sh	Fri Apr 28 12:10:16 2017	(r317550)
@@ -36,16 +36,17 @@
 
 . ../default.cfg
 
-mount | grep nullfs | grep -q /tmp/1 && umount /tmp/1
+nullfs_srcdir=${nullfs_srcdir:-/tmp}
+mount | grep nullfs | grep -q $nullfs_srcdir/1 && umount $nullfs_srcdir/1
 
-rm -rf /tmp/1 /tmp/2
-mkdir /tmp/1 /tmp/2
-touch /tmp/1/test.file
+rm -rf $nullfs_srcdir/1 $nullfs_srcdir/2
+mkdir $nullfs_srcdir/1 $nullfs_srcdir/2
+touch $nullfs_srcdir/1/test.file
 
-mount -t nullfs /tmp/1 /tmp/2
+mount -t nullfs $nullfs_srcdir/1 $nullfs_srcdir/2
 
-cp /tmp/1/test.file /tmp/2/test.file	# scenario by kib
-mv /tmp/1/test.file /tmp/2/		# panics with lock violation
+cp $nullfs_srcdir/1/test.file $nullfs_srcdir/2/test.file	# scenario by kib
+mv $nullfs_srcdir/1/test.file $nullfs_srcdir/2/	# panics with lock violation
 
-umount /tmp/1
-rm -rf /tmp/1 /tmp/2
+umount $nullfs_srcdir/1
+rm -rf $nullfs_srcdir/1 $nullfs_srcdir/2

Modified: user/pho/stress2/misc/nullfs8.sh
==============================================================================
--- user/pho/stress2/misc/nullfs8.sh	Fri Apr 28 12:07:23 2017	(r317549)
+++ user/pho/stress2/misc/nullfs8.sh	Fri Apr 28 12:10:16 2017	(r317550)
@@ -36,12 +36,13 @@
 
 . ../default.cfg
 
+nullfs_srcdir=${nullfs_srcdir:-/tmp}
 opt="-o nfsv3,rw,udp,rdirplus,noauto,retrycnt=3"
 grep -q $mntpoint /etc/exports ||
     { echo "$mntpoint missing from /etc/exports"; exit 0; }
 
 mount | grep -wq $mntpoint && umount $mntpoint
-mount -t nullfs /tmp $mntpoint
+mount -t nullfs $nullfs_srcdir $mntpoint
 
 mntpoint2=${mntpoint}2
 mntpoint3=${mntpoint}3
@@ -54,11 +55,11 @@ done
 for i in `jot 50` ; do
 	su $testuser -c "cp -r /usr/include $mntpoint2/nullfs8-2 2>/dev/null" &
 	su $testuser -c "cp -r /usr/include $mntpoint3/nullfs8-2 2>/dev/null" &
-	wait;wait
+	wait
 	su $testuser -c "find $mntpoint2 > /dev/null 2>&1" &
 	su $testuser -c "find $mntpoint3 > /dev/null 2>&1" &
-	wait;wait
-	rm -rf /tmp/nullfs8-2
+	wait
+	rm -rf $nullfs_srcdir/nullfs8-2
 done
 
 for m in $mntpoint3 $mntpoint2 $mntpoint; do

From owner-svn-src-user@freebsd.org  Fri Apr 28 12:12:26 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E2D6D54A73
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Fri, 28 Apr 2017 12:12:26 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3EFB51E64;
 Fri, 28 Apr 2017 12:12:26 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3SCCPAt038271;
 Fri, 28 Apr 2017 12:12:25 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3SCCPHG038267;
 Fri, 28 Apr 2017 12:12:25 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704281212.v3SCCPHG038267@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Fri, 28 Apr 2017 12:12:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317551 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 28 Apr 2017 12:12:26 -0000

Author: pho
Date: Fri Apr 28 12:12:24 2017
New Revision: 317551
URL: https://svnweb.freebsd.org/changeset/base/317551

Log:
  Added "Fixed by" and problem found.
  
  Sponsored by:	Dell EMC Isilon

Modified:
  user/pho/stress2/misc/nullfs13.sh
  user/pho/stress2/misc/nullfs18.sh
  user/pho/stress2/misc/nullfs5.sh

Modified: user/pho/stress2/misc/nullfs13.sh
==============================================================================
--- user/pho/stress2/misc/nullfs13.sh	Fri Apr 28 12:10:16 2017	(r317550)
+++ user/pho/stress2/misc/nullfs13.sh	Fri Apr 28 12:12:24 2017	(r317551)
@@ -31,6 +31,8 @@
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
 
 # kern/178238 "nullfs don't release i-nodes on unlink"
+# See also nullfs16.sh
+# Fixed by: r292961.
 
 . ../default.cfg
 

Modified: user/pho/stress2/misc/nullfs18.sh
==============================================================================
--- user/pho/stress2/misc/nullfs18.sh	Fri Apr 28 12:10:16 2017	(r317550)
+++ user/pho/stress2/misc/nullfs18.sh	Fri Apr 28 12:12:24 2017	(r317551)
@@ -31,7 +31,7 @@
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
 
 # Demonstate nullfs(5) inode leak.
-# Fixed by 295717.
+# Fixed by r295717.
 
 . ../default.cfg
 

Modified: user/pho/stress2/misc/nullfs5.sh
==============================================================================
--- user/pho/stress2/misc/nullfs5.sh	Fri Apr 28 12:10:16 2017	(r317550)
+++ user/pho/stress2/misc/nullfs5.sh	Fri Apr 28 12:12:24 2017	(r317551)
@@ -39,6 +39,9 @@
 # panic: vholdl: inactive held vnode:
 # https://people.freebsd.org/~pho/stress/log/kostik815.txt
 
+# umount busy seen:
+# https://people.freebsd.org/~pho/stress/log/kostik893.txt
+
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
 
 . ../default.cfg

From owner-svn-src-user@freebsd.org  Fri Apr 28 15:15:29 2017
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09D55D5480F
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Fri, 28 Apr 2017 15:15:29 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C1155792;
 Fri, 28 Apr 2017 15:15:28 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3SFFR7Y012382;
 Fri, 28 Apr 2017 15:15:27 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3SFFRcC012373;
 Fri, 28 Apr 2017 15:15:27 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201704281515.v3SFFRcC012373@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Fri, 28 Apr 2017 15:15:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r317557 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 28 Apr 2017 15:15:29 -0000

Author: pho
Date: Fri Apr 28 15:15:26 2017
New Revision: 317557
URL: https://svnweb.freebsd.org/changeset/base/317557

Log:
  Need the x option for ps, in case we do not have a controlling terminal.
  
  Sponsored by:	Dell EMC Isilon

Modified:
  user/pho/stress2/misc/fifo3.sh
  user/pho/stress2/misc/graid1_2.sh
  user/pho/stress2/misc/mlockall.sh
  user/pho/stress2/misc/mountro.sh
  user/pho/stress2/misc/ptrace10.sh
  user/pho/stress2/misc/truncate2.sh
  user/pho/stress2/misc/truss.sh
  user/pho/stress2/misc/vfork.sh

Modified: user/pho/stress2/misc/fifo3.sh
==============================================================================
--- user/pho/stress2/misc/fifo3.sh	Fri Apr 28 14:48:29 2017	(r317556)
+++ user/pho/stress2/misc/fifo3.sh	Fri Apr 28 15:15:26 2017	(r317557)
@@ -197,7 +197,7 @@ mount /dev/md${mdstart}$part $mntpoint
 (cd $mntpoint; /tmp/fifo3 ) &
 
 while pgrep -q fifo3; do
-	ps -l | grep -v grep | grep -q fifoor &&
+	ps -lx | grep -v grep | grep -q fifoor &&
 	    { echo FAIL; exit 1; }
 	sleep 2
 done

Modified: user/pho/stress2/misc/graid1_2.sh
==============================================================================
--- user/pho/stress2/misc/graid1_2.sh	Fri Apr 28 14:48:29 2017	(r317556)
+++ user/pho/stress2/misc/graid1_2.sh	Fri Apr 28 15:15:26 2017	(r317557)
@@ -72,7 +72,7 @@ while [ $((`date '+%s'` - start)) -lt 30
 	gmirror rebuild test /dev/md$md1
 	sleep 2
 	n=0
-	while ps -l | grep -v grep | grep graid1_2 | grep -q D; do
+	while ps -lx | grep -v grep | grep graid1_2 | grep -q D; do
 		opid=$pid
 		pid=`pgrep graid1_2`
 		[ -z "$pid" -o "$pid" != "$opid" ] && n=0
@@ -80,7 +80,7 @@ while [ $((`date '+%s'` - start)) -lt 30
 		n=$((n + 1))
 		if [ $n -gt 180 ]; then
 			echo FAIL
-			ps -l | grep -v grep | grep graid1_2 | grep D
+			ps -lx | grep -v grep | grep graid1_2 | grep D
 			exit 1
 		fi
 	done

Modified: user/pho/stress2/misc/mlockall.sh
==============================================================================
--- user/pho/stress2/misc/mlockall.sh	Fri Apr 28 14:48:29 2017	(r317556)
+++ user/pho/stress2/misc/mlockall.sh	Fri Apr 28 15:15:26 2017	(r317557)
@@ -43,7 +43,8 @@ rm -f mlockall.c
 for i in `jot 10`; do
 	/tmp/mlockall &
 	sleep 1
-	ps | grep /tmp/mlockall | grep -v grep | awk '{print $1}' | while read pid; do
+	ps -x | grep /tmp/mlockall | grep -v grep | awk '{print $1}' | \
+	    while read pid; do
 		kill -2 $pid
 		kill -9 $pid
 	done

Modified: user/pho/stress2/misc/mountro.sh
==============================================================================
--- user/pho/stress2/misc/mountro.sh	Fri Apr 28 14:48:29 2017	(r317556)
+++ user/pho/stress2/misc/mountro.sh	Fri Apr 28 15:15:26 2017	(r317557)
@@ -64,5 +64,5 @@ df -i $mntpoint
 umount -f $mntpoint    > /dev/null 2>&1
 mdconfig -d -u $mdstart
 rm -f $D
-kill `ps | grep run.sh | grep -v grep | awk '{print $1}'`
+kill `ps -x | grep run.sh | grep -v grep | awk '{print $1}'`
 wait

Modified: user/pho/stress2/misc/ptrace10.sh
==============================================================================
--- user/pho/stress2/misc/ptrace10.sh	Fri Apr 28 14:48:29 2017	(r317556)
+++ user/pho/stress2/misc/ptrace10.sh	Fri Apr 28 15:15:26 2017	(r317557)
@@ -125,7 +125,7 @@ rm ptrace10.c
 ./ptrace10
 s=$?
 if [ $s -ne 0 ]; then
-	ps -lH | grep -v grep | egrep "UID|ptrace10"
+	ps -lxH | grep -v grep | egrep "UID|ptrace10"
 	while pgrep -q ptrace10; do
 		pkill -9 ptrace10
 	done

Modified: user/pho/stress2/misc/truncate2.sh
==============================================================================
--- user/pho/stress2/misc/truncate2.sh	Fri Apr 28 14:48:29 2017	(r317556)
+++ user/pho/stress2/misc/truncate2.sh	Fri Apr 28 15:15:26 2017	(r317557)
@@ -41,7 +41,7 @@ cd $RUNDIR
 /tmp/truncate2 &
 
 sleep 1
-while ps | grep -v grep | egrep -q "truncate2$"; do
+while ps -x | grep -v grep | egrep -q "truncate2$"; do
 	$here/../testcases/swap/swap -t 2m -i 20
 done
 

Modified: user/pho/stress2/misc/truss.sh
==============================================================================
--- user/pho/stress2/misc/truss.sh	Fri Apr 28 14:48:29 2017	(r317556)
+++ user/pho/stress2/misc/truss.sh	Fri Apr 28 15:15:26 2017	(r317557)
@@ -59,7 +59,7 @@ sleep .5
 for i in `jot 30`; do
 	truss /tmp/ttruss 10 > /dev/null 2>&1 &
 	sleep 11
-	if ps -l | grep -v grep | grep -q uwrlck; then
+	if ps -lx | grep -v grep | grep -q uwrlck; then
 		echo FAIL
 		ps -lH | egrep -v "grep|truss.sh" | grep truss
 		while pkill -9 swap; do
@@ -75,7 +75,7 @@ done
 sleep 2
 if pgrep -q ttruss; then
 	echo FAIL
-	ps -lH | grep -v grep | grep ttruss
+	ps -lxH | grep -v grep | grep ttruss
 	s=1
 fi
 

Modified: user/pho/stress2/misc/vfork.sh
==============================================================================
--- user/pho/stress2/misc/vfork.sh	Fri Apr 28 14:48:29 2017	(r317556)
+++ user/pho/stress2/misc/vfork.sh	Fri Apr 28 15:15:26 2017	(r317557)
@@ -98,7 +98,7 @@ main(int argc, char **argv)
 	bzero(&ru, sizeof(ru));
 	usleep(2000);
 	if ((rpid = wait4(-1, &status, WNOHANG, &ru)) == -1) {
-			err(1, "OK wait4");
+			err(0, "OK wait4");
 	}
 	if (rpid == 0) {
 //		fprintf(stderr, "No rusage info.\n");
@@ -122,10 +122,12 @@ rm  vfork2.c
 
 ./vfork1 &
 sleep .2
-childpid=`ps -l | grep -v grep | grep vfork1 |
+childpid=`ps -lx | grep -v grep | grep vfork1 |
     tail -1 | grep nanslp | awk '{print $2}'`
 # Seen before fix:
 # failed to set signal flags properly for ast()
 ./vfork2 $childpid
+s=$?
 
 rm -f vfork1 vfork2
+exit $s