Index: user/pho/stress2/misc/dangling.sh =================================================================== --- user/pho/stress2/misc/dangling.sh (revision 318778) +++ user/pho/stress2/misc/dangling.sh (revision 318779) @@ -1,89 +1,89 @@ #!/bin/sh # # Copyright (c) 2014 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 # "panic: softdep_deallocate_dependencies: dangling deps" seen. # "panic: softdep_write_inodeblock: indirect pointer #0 mismatch" seen. # http://people.freebsd.org/~pho/stress/log/dangling.txt # http://people.freebsd.org/~pho/stress/log/dangling2.txt # Test scenario seems optimized for 4 CPUs. . ../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 4g -u $mdstart || exit 1 bsdlabel -w md$mdstart auto newfs $newfs_flags md${mdstart}$part > /dev/null mount /dev/md${mdstart}$part $mntpoint || exit 1 chmod 777 $mntpoint export runRUNTIME=4m export RUNDIR=$mntpoint/stressX -set `df -ik /mnt | tail -1 | awk '{print $4,$7}'` +set `df -ik $mntpoint | tail -1 | awk '{print $4,$7}'` export KBLOCKS=$(($1 / 4)) export INODES=$(($2 / 4)) export symlinkHOG=1 export rwHOG=1 export mkdirHOG=1 export LOAD=100 export symlinkLOAD=100 export rwLOAD=100 export mkdirLOAD=100 export TESTPROGS=" testcases/symlink/symlink testcases/fts/fts testcases/mkdir/mkdir testcases/rw/rw " for i in `jot 10`; do su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' > \ /dev/null 2>&1 & sleep 60 kill $! ../tools/killall.sh > /dev/null 2>&1 ../tools/killall.sh > /dev/null 2>&1 wait done s=0 for i in `jot 6`; do umount $mntpoint && break || sleep 10 done [ $i -eq 6 ] && s=1 mdconfig -d -u $mdstart exit $s Index: user/pho/stress2/misc/extattr.sh =================================================================== --- user/pho/stress2/misc/extattr.sh (revision 318778) +++ user/pho/stress2/misc/extattr.sh (revision 318779) @@ -1,98 +1,98 @@ #!/bin/sh # # Copyright (c) 2009 Peter Holm # 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$ # # Regression test of extattr on a UFS2 FS using ACLs # Caused a "Duplicate free" panic. [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg [ "`sysctl -in kern.features.ufs_extattr`" != "1" ] && exit 0 [ -z "`which setfacl`" ] && exit 0 odir=`pwd` cd /tmp sed '1,/^EOF/d' < $odir/$0 > extattr.c mycc -o extattr -Wall extattr.c rm -f extattr.c cd $odir mount | grep "$mntpoint" | grep -q md${mdstart}$part && umount $mntpoint mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart mdconfig -a -t swap -s 20m -u $mdstart bsdlabel -w md$mdstart auto newfs -O 2 md${mdstart}$part > /dev/null mount /dev/md${mdstart}$part $mntpoint mkdir -p $mntpoint/.attribute/system cd $mntpoint/.attribute/system extattrctl initattr -p . 388 posix1e.acl_access extattrctl initattr -p . 388 posix1e.acl_default cd / -umount /mnt +umount $mntpoint tunefs -a enable /dev/md${mdstart}$part mount /dev/md${mdstart}$part $mntpoint mount | grep md${mdstart}$part touch $mntpoint/acl-test setfacl -b $mntpoint/acl-test setfacl -m user:nobody:rw-,group:wheel:rw- $mntpoint/acl-test for i in `jot 5`; do /tmp/extattr $mntpoint/acl-test & done for i in `jot 5`; do wait done umount $mntpoint mdconfig -d -u $mdstart rm -f /tmp/extattr exit EOF #include #include #include int main(int argc, char **argv) { int i; struct stat sb; for (i = 0; i < 100000; i++) if (lstat(argv[1], &sb) == -1) err(1, "lstat(%s)", argv[1]); return (0); } Index: user/pho/stress2/misc/extattrctl.sh =================================================================== --- user/pho/stress2/misc/extattrctl.sh (revision 318778) +++ user/pho/stress2/misc/extattrctl.sh (revision 318779) @@ -1,75 +1,75 @@ #!/bin/sh # # Copyright (c) 2009 Peter Holm # 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$ # # Regression test of extattrctl and ACLs on UFS1 FS # Kernel must be compiled with options UFS_EXTATTR and UFS_EXTATTR_AUTOSTART # Scenario by rwatson@ from: # # Newsgroups: lucky.freebsd.current # Subject: Re: setfacl requirements? # Date: Thu, 5 Dec 2002 15:50:02 +0000 (UTC) [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg [ "`sysctl -in kern.features.ufs_extattr`" != "1" ] && exit 0 [ -z "`which setfacl`" ] && exit 0 mount | grep "$mntpoint" | grep -q md${mdstart}$part && umount $mntpoint mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart mdconfig -a -t swap -s 20m -u $mdstart bsdlabel -w md$mdstart auto newfs -O 1 md${mdstart}$part > /dev/null mount /dev/md${mdstart}$part $mntpoint mkdir -p $mntpoint/.attribute/system cd $mntpoint/.attribute/system extattrctl initattr -p . 388 posix1e.acl_access extattrctl initattr -p . 388 posix1e.acl_default cd / -umount /mnt +umount $mntpoint tunefs -a enable /dev/md${mdstart}$part mount /dev/md${mdstart}$part $mntpoint mount | grep md${mdstart}$part touch $mntpoint/acl-test setfacl -b $mntpoint/acl-test setfacl -m user:nobody:rw-,group:wheel:rw- $mntpoint/acl-test getfacl $mntpoint/acl-test ls -l $mntpoint/acl-test umount $mntpoint mdconfig -d -u $mdstart Index: user/pho/stress2/misc/isofs3.sh =================================================================== --- user/pho/stress2/misc/isofs3.sh (revision 318778) +++ user/pho/stress2/misc/isofs3.sh (revision 318779) @@ -1,68 +1,68 @@ #!/bin/sh # # Copyright (c) 2016 Dell EMC # 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$ # # Simple isofs / union test scenario [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ -z "`which mkisofs`" ] && echo "mkisofs not found" && exit 0 . ../default.cfg D=`dirname $diskimage`/dir I=`dirname $diskimage`/dir.iso rm -rf $D $I mkdir -p $D cp -r ../../stress2 $D 2>/dev/null mkisofs -o $I -r $D > /dev/null 2>&1 mount | grep -q /dev/md${mdstart}$part && umount -f /dev/md${mdstart}$part [ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart mdconfig -a -t vnode -f $I -u $mdstart || exit 1 mount -t cd9660 /dev/md$mdstart $mntpoint || exit 1 m2=$((mdstart + 1)) mdconfig -s 1g -u $m2 bsdlabel -w md$m2 auto newfs $newfs_flags md${m2}$part > /dev/null mount -o union /dev/md${m2}$part $mntpoint || exit 1 export RUNDIR=$mntpoint/stressX export runRUNTIME=5m (cd $mntpoint/stress2; ./run.sh marcus.cfg) > /dev/null -umount /mnt +umount $mntpoint mdconfig -d -u $m2 -umount /mnt +umount $mntpoint mdconfig -d -u $mdstart rm -rf $D $I exit 0 Index: user/pho/stress2/misc/md3.sh =================================================================== --- user/pho/stress2/misc/md3.sh (revision 318778) +++ user/pho/stress2/misc/md3.sh (revision 318779) @@ -1,58 +1,58 @@ #!/bin/sh # # Copyright (c) 2009-2011 Peter Holm # 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$ # # Test scenario for deadlock fixed in r200447 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg mount | grep -q "$mntpoint" && umount $mntpoint mdconfig -l | grep -q $mdstart && mdconfig -d -u $mdstart mdconfig -a -t swap -s 1400m -u $mdstart bsdlabel -w md$mdstart auto newfs $newfs_flags md5$part > /dev/null mount /dev/md5$part $mntpoint # Stop FS "out of inodes" problem by only using 70% -set `df -ik /mnt | tail -1 | awk '{print $4,$7}'` +set `df -ik $mntpoint | tail -1 | awk '{print $4,$7}'` export KBLOCKS=$(($1 / 10 * 7)) export INODES=$(($2 / 10 * 7)) export RUNDIR=$mntpoint/stressX export runRUNTIME=10m (cd ..; ./run.sh marcus.cfg) umount $mntpoint mount | grep -q "$mntpoint" && umount -f $mntpoint mdconfig -d -u $mdstart Index: user/pho/stress2/misc/mlockall4.sh =================================================================== --- user/pho/stress2/misc/mlockall4.sh (revision 318778) +++ user/pho/stress2/misc/mlockall4.sh (revision 318779) @@ -1,68 +1,68 @@ #!/bin/sh # # Copyright (c) 2013 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$ # # mlockall(2) / nullfs(5) scenario causes: # http://people.freebsd.org/~pho/stress/log/kostik619.txt # kern/182661, fixed in r256211. . ../default.cfg [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 odir=`pwd` cd /tmp sed '1,/^EOF/d' < $odir/$0 > mlockall4.c mycc -o mlockall4 -Wall -Wextra mlockall4.c || exit 1 rm -f mlockall4.c mount | grep -q "on $mntpoint " && umount -f $mntpoint mount -t nullfs /tmp $mntpoint -/mnt/mlockall4 & +$mntpoint/mlockall4 & sleep 2 umount -f $mntpoint wait rm -f /tmp/mlockall4 exit EOF #include #include #include #include int main(void) { if (mlockall(MCL_CURRENT | MCL_FUTURE) == -1) err(1, "mlockall(MCL_CURRENT | MCL_FUTURE)"); sleep(5); return (0); } Index: user/pho/stress2/misc/mmap29.sh =================================================================== --- user/pho/stress2/misc/mmap29.sh (revision 318778) +++ user/pho/stress2/misc/mmap29.sh (revision 318779) @@ -1,73 +1,73 @@ #!/bin/sh # $FreeBSD$ # Test scenario by: David Cross # "panic: softdep_deallocate_dependencies: dangling deps" seen. # https://people.freebsd.org/~pho/stress/log/mmap29.txt # Fixed by: r302567. . ../default.cfg [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ -z "`which timeout`" ] && exit 0 mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart mdconfig -a -t swap -s 2g -u $mdstart || exit 1 bsdlabel -w md$mdstart auto newfs -U md${mdstart}$part > /dev/null mount /dev/md${mdstart}$part $mntpoint -mkdir /mnt/mmap29 +mkdir $mntpoint/mmap29 cd /tmp cat > mmap29.c < #include #include #include #include #include #include #include int main(int argc, char **argv) { int fd; unsigned char *memrange; if (argc != 2) { fprintf(stderr, "Usage: %s \n", argv[0]); exit(1); } unlink(argv[1]); if ((fd = open(argv[1], O_RDWR | O_CREAT, DEFFILEMODE)) == -1) err(1, "open(%s)", argv[1]); lseek(fd, 0xbfff, SEEK_SET); write(fd, "\0", 1); if ((memrange = mmap(0, 0x2b6000, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_HASSEMAPHORE | MAP_NOSYNC, fd, 0)) == MAP_FAILED) err(1, "mmap"); memrange[0] = 5; munmap(memrange, 0x2b6000); close(fd); return (0); } EOFHERE cc -o mmap29 -Wall -Wextra -O0 -g mmap29.c || exit 1 rm mmap29.c -./mmap29 /mnt/mmap29/mmap291 +./mmap29 $mntpoint/mmap29/mmap291 old=`sysctl -n kern.maxvnodes` trap "sysctl kern.maxvnodes=$old" EXIT INT sysctl kern.maxvnodes=2000 timeout 60 find / -xdev -print >/dev/null while mount | grep "on $mntpoint " | grep -q /dev/md; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart rm mmap29 exit 0 Index: user/pho/stress2/misc/overcommit2.sh =================================================================== --- user/pho/stress2/misc/overcommit2.sh (revision 318778) +++ user/pho/stress2/misc/overcommit2.sh (revision 318779) @@ -1,68 +1,68 @@ #!/bin/sh # # Copyright (c) 2014 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$ # # Test vm.overcommit. Variation of overcommit.sh # Use a swap backed MD disk with the size of 1.2 * hw.usermem. # Deadlock seen: https://people.freebsd.org/~pho/stress/log/alan007.txt [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ `swapinfo | wc -l` -eq 1 ] && exit 0 . ../default.cfg old=`sysctl -n vm.overcommit` [ $old -eq 1 ] && exit size=$((`sysctl -n hw.usermem` / 1024 / 1024)) # in MB size=$((size + size / 100 * 20)) # 120% of hw.usermem sysctl vm.overcommit=1 trap "sysctl vm.overcommit=$old" EXIT INT 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 ${size}m -u $mdstart bsdlabel -w md$mdstart auto newfs $newfs_flags md${mdstart}$part > /dev/null mount /dev/md${mdstart}$part $mntpoint echo "Expect: /mnt: write failed, filesystem is full dd: /mnt/big.1: No space left on device" for i in `jot 10`; do - dd if=/dev/zero of=/mnt/big.$i bs=1m 2>&1 | \ + dd if=/dev/zero of=$mntpoint/big.$i bs=1m 2>&1 | \ egrep -v "records|transferred" & done wait while mount | grep "on $mntpoint " | grep -q /dev/md; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart Index: user/pho/stress2/misc/quota9.sh =================================================================== --- user/pho/stress2/misc/quota9.sh (revision 318778) +++ user/pho/stress2/misc/quota9.sh (revision 318779) @@ -1,92 +1,92 @@ #!/bin/sh # # Copyright (c) 2008 Peter Holm # 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$ # # Test if quotacheck reports actual usage . ../default.cfg export tmp=/tmp/$(basename $0).$$ export D=$diskimage qc() { quotacheck -v $1 > $tmp 2>&1 grep -q fixed $tmp && cat $tmp } 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 [ -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}'` 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 qc $mntpoint su $testuser $0 xxx - du -k /mnt/stressX + du -k $mntpoint/stressX 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 done mdconfig -d -u $mdstart rm -f $D else for i in `jot 20`; do dede $mntpoint/stressX/d$i 1m 1 done fi exit 0 Index: user/pho/stress2/misc/sigxcpu.sh =================================================================== --- user/pho/stress2/misc/sigxcpu.sh (revision 318778) +++ user/pho/stress2/misc/sigxcpu.sh (revision 318779) @@ -1,155 +1,155 @@ #!/bin/sh # # Copyright (c) 2013 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 # "panic: softdep_deallocate_dependencies: dangling deps" seen: # http://people.freebsd.org/~pho/stress/log/sigxcpu7.txt . ../default.cfg here=`pwd` cd /tmp sed '1,/^EOF/d' < $here/$0 > sigxcpu.c mycc -o sigxcpu -Wall -Wextra sigxcpu.c rm -f sigxcpu.c cd $here 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 4g -u $mdstart || exit 1 bsdlabel -w md$mdstart auto newfs $newfs_flags md${mdstart}$part > /dev/null mount /dev/md${mdstart}$part $mntpoint chmod 777 $mntpoint export runRUNTIME=4m export RUNDIR=$mntpoint/stressX -set `df -ik /mnt | tail -1 | awk '{print $4,$7}'` +set `df -ik $mntpoint | tail -1 | awk '{print $4,$7}'` export KBLOCKS=$(($1 / 4)) export INODES=$(($2 / 4)) su $testuser -c 'ulimit -t 3; cd ..; ./run.sh marcus.cfg' > /dev/null & sleep 2 for i in `jot 10`; do /tmp/sigxcpu $mntpoint done kill $! ../tools/killall.sh ../tools/killall.sh wait while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart rm -f /tmp/sigxcpu exit EOF #include #include #include #include #include #include #include #include #include #include static void hand(int i __unused) { /* handler */ _exit(1); } int test(char *path) { FTS *fts; FTSENT *p; int ftsoptions; char *args[2]; ftsoptions = FTS_PHYSICAL; args[0] = path; args[1] = 0; if ((fts = fts_open(args, ftsoptions, NULL)) == NULL) err(1, "fts_open"); while ((p = fts_read(fts)) != NULL) { switch (p->fts_info) { case FTS_F: /* Ignore. */ break; case FTS_D: /* Ignore. */ break; case FTS_DP: break; case FTS_DC: /* Ignore. */ break; case FTS_SL: /* Ignore. */ break; case FTS_DNR: /* Warn, continue. */ case FTS_ERR: case FTS_NS: case FTS_DEFAULT: break; default: printf("%s: default, %d\n", getprogname(), p->fts_info); break; } } if (errno != 0 && errno != ENOENT) err(1, "fts_read"); if (fts_close(fts) == -1) err(1, "fts_close()"); return (0); } int main(int argc, char **argv) { int i; if (argc != 2) errx(1, "Usage: %s ", argv[0]); signal(SIGALRM, hand); alarm(20); for (i = 0; i < 100; i++) test(argv[1]); return (0); } Index: user/pho/stress2/misc/snap9.sh =================================================================== --- user/pho/stress2/misc/snap9.sh (revision 318778) +++ user/pho/stress2/misc/snap9.sh (revision 318779) @@ -1,68 +1,68 @@ #!/bin/sh # # Copyright (c) 2013 Peter Holm # 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$ # # Disk full with one snapshot scenario # "panic: softdep_deallocate_dependencies: unrecovered I/O error" seen. # kern/162362: ufs with snapshot(s) panics when getting full [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../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 2g -u $mdstart || exit 1 bsdlabel -w md$mdstart auto newfs $newfs_flags md${mdstart}$part > /dev/null mount /dev/md${mdstart}$part $mntpoint dd if=/dev/zero of=$mntpoint/big1 bs=1m count=512 2>&1 | \ egrep -v "records|transferred" dd if=/dev/zero of=$mntpoint/big2 bs=1m count=512 2>&1 | \ egrep -v "records|transferred" dd if=/dev/zero of=$mntpoint/big3 bs=1m count=512 2>&1 | \ egrep -v "records|transferred" mksnap_ffs $mntpoint $mntpoint/.snap/snap for i in `jot 10`; do dd if=/dev/zero of=$mntpoint/big.$i bs=1m count=512 2>&1 | \ egrep -v "records|transferred" || break done rm $mntpoint/big.* rm -f $mntpoint/.snap/snap while mount | grep "$mntpoint" | grep -q md$mdstart; do - umount /mnt || sleep 1 + umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart Index: user/pho/stress2/misc/suj16.sh =================================================================== --- user/pho/stress2/misc/suj16.sh (revision 318778) +++ user/pho/stress2/misc/suj16.sh (revision 318779) @@ -1,84 +1,84 @@ #!/bin/sh # # Copyright (c) 2011 Peter Holm # 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$ # # mksnap_ffs(8) test scenario # Livelock seen in ffs_sync(). # "panic: initiate_write_bmsafemap: block 846816 marked free" seen. # Zero size snapshot file seen. [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../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 2g -u $mdstart || exit 1 bsdlabel -w md$mdstart auto newfs -j md${mdstart}$part > /dev/null 2>&1 mount /dev/md${mdstart}$part $mntpoint chmod 777 $mntpoint export runRUNTIME=30m export RUNDIR=$mntpoint/stressX export creatINCARNATIONS=2 export TESTPROGS=" testcases/creat/creat " su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' > /dev/null 2>&1 & rpid=$! mdstart2=$((mdstart + 1)) mntpoint2=${mntpoint}2 [ -d $mntpoint2 ] || mkdir $mntpoint2 mount | grep $mntpoint2 | grep -q /dev/md && umount -f $mntpoint2 mdconfig -l | grep -q md$mdstart2 && mdconfig -d -u $mdstart2 while kill -0 $rpid 2> /dev/null; do - rm -f /mnt/.snap/suj16 - { mksnap_ffs /mnt /mnt/.snap/suj16 || continue; } 2>&1 | \ + rm -f $mntpoint/.snap/suj16 + { mksnap_ffs $mntpoint $mntpoint/.snap/suj16 || continue; } 2>&1 | \ grep -v "Resource temporarily unavailable" - [ ! -s /mnt/.snap/suj16 ] && continue - mdconfig -a -t vnode -f /mnt/.snap/suj16 -u $mdstart2 -o readonly + [ ! -s $mntpoint/.snap/suj16 ] && continue + mdconfig -a -t vnode -f $mntpoint/.snap/suj16 -u $mdstart2 -o readonly mount -r /dev/md$mdstart2 $mntpoint2 ls -l $mntpoint2 > /dev/null umount $mntpoint2 mdconfig -d -u $mdstart2 done wait while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart Index: user/pho/stress2/misc/suj26.sh =================================================================== --- user/pho/stress2/misc/suj26.sh (revision 318778) +++ user/pho/stress2/misc/suj26.sh (revision 318779) @@ -1,87 +1,87 @@ #!/bin/sh # # Copyright (c) 2012 Peter Holm # 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$ # # Variation of suj16.sh with more test programs and VM pressure. # Deadlocks seen. [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../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 2g -u $mdstart || exit 1 bsdlabel -w md$mdstart auto [ $# -eq 1 ] && opt="$1" || opt="-j" newfs $opt md${mdstart}$part > /dev/null 2>&1 mount /dev/md${mdstart}$part $mntpoint chmod 777 $mntpoint export runRUNTIME=30m export RUNDIR=$mntpoint/stressX export creatINCARNATIONS=2 export TESTPROGS=" testcases/creat/creat testcases/mkdir/mkdir testcases/swap/swap " su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' > /dev/null 2>&1 & rpid=$! mdstart2=$((mdstart + 1)) mntpoint2=${mntpoint}2 [ -d $mntpoint2 ] || mkdir $mntpoint2 mount | grep $mntpoint2 | grep -q /dev/md && umount -f $mntpoint2 mdconfig -l | grep -q md$mdstart2 && mdconfig -d -u $mdstart2 while kill -0 $rpid 2> /dev/null; do - rm -f /mnt/.snap/suj26 - { mksnap_ffs /mnt /mnt/.snap/suj26 || continue; } 2>&1 | \ + rm -f $mntpoint/.snap/suj26 + { mksnap_ffs $mntpoint $mntpoint/.snap/suj26 || continue; } 2>&1 | \ grep -v "Resource temporarily unavailable" - [ ! -s /mnt/.snap/suj26 ] && continue - mdconfig -a -t vnode -f /mnt/.snap/suj26 -u $mdstart2 -o readonly + [ ! -s $mntpoint/.snap/suj26 ] && continue + mdconfig -a -t vnode -f $mntpoint/.snap/suj26 -u $mdstart2 -o readonly mount -r /dev/md$mdstart2 $mntpoint2 ls -l $mntpoint2 > /dev/null while mount | grep $mntpoint2 | grep -q /dev/md; do umount $mntpoint2 || sleep 1 done mdconfig -d -u $mdstart2 done wait while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart Index: user/pho/stress2/misc/suj27.sh =================================================================== --- user/pho/stress2/misc/suj27.sh (revision 318778) +++ user/pho/stress2/misc/suj27.sh (revision 318779) @@ -1,86 +1,86 @@ #!/bin/sh # # Copyright (c) 2012 Peter Holm # 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$ # # Variation of suj26.sh with one more test program. # Deadlocks seen. [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../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 2g -u $mdstart || exit 1 bsdlabel -w md$mdstart auto [ $# -eq 1 ] && opt="$1" || opt="-j" newfs $opt md${mdstart}$part > /dev/null 2>&1 mount /dev/md${mdstart}$part $mntpoint chmod 777 $mntpoint export runRUNTIME=30m export RUNDIR=$mntpoint/stressX export creatINCARNATIONS=2 export TESTPROGS=" testcases/creat/creat testcases/mkdir/mkdir testcases/rw/rw testcases/swap/swap " su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' > /dev/null 2>&1 & rpid=$! mdstart2=$((mdstart + 1)) mntpoint2=${mntpoint}2 [ -d $mntpoint2 ] || mkdir $mntpoint2 mount | grep $mntpoint2 | grep -q /dev/md && umount -f $mntpoint2 mdconfig -l | grep -q md$mdstart2 && mdconfig -d -u $mdstart2 while kill -0 $rpid 2> /dev/null; do - rm -f /mnt/.snap/suj27 - { mksnap_ffs /mnt /mnt/.snap/suj27 || continue; } 2>&1 | \ + rm -f $mntpoint/.snap/suj27 + { mksnap_ffs $mntpoint $mntpoint/.snap/suj27 || continue; } 2>&1 | \ grep -v "Resource temporarily unavailable" - [ ! -s /mnt/.snap/suj27 ] && continue - mdconfig -a -t vnode -f /mnt/.snap/suj27 -u $mdstart2 -o readonly + [ ! -s $mntpoint/.snap/suj27 ] && continue + mdconfig -a -t vnode -f $mntpoint/.snap/suj27 -u $mdstart2 -o readonly mount -r /dev/md$mdstart2 $mntpoint2 ls -l $mntpoint2 > /dev/null umount $mntpoint2 mdconfig -d -u $mdstart2 done wait while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart Index: user/pho/stress2/misc/suj28.sh =================================================================== --- user/pho/stress2/misc/suj28.sh (revision 318778) +++ user/pho/stress2/misc/suj28.sh (revision 318779) @@ -1,89 +1,89 @@ #!/bin/sh # # Copyright (c) 2012 Peter Holm # 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$ # # Variation of suj26.sh where a missing "umount /mnt2" causes the following # mksnap_ffs to loop. [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../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 2g -u $mdstart || exit 1 bsdlabel -w md$mdstart auto [ $# -eq 1 ] && opt="$1" || opt="-j" newfs $opt md${mdstart}$part > /dev/null 2>&1 mount /dev/md${mdstart}$part $mntpoint mount chmod 777 $mntpoint export runRUNTIME=5m export RUNDIR=$mntpoint/stressX export creatINCARNATIONS=2 export TESTPROGS=" testcases/creat/creat testcases/mkdir/mkdir testcases/swap/swap " su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' > /dev/null 2>&1 & rpid=$! mdstart2=$((mdstart + 1)) mntpoint2=${mntpoint}2 [ -d $mntpoint2 ] || mkdir $mntpoint2 mount | grep $mntpoint2 | grep -q /dev/md && umount -f $mntpoint2 mdconfig -l | grep -q md$mdstart2 && mdconfig -d -u $mdstart2 while kill -0 $rpid 2> /dev/null; do - rm -f /mnt/.snap/suj28 - { mksnap_ffs /mnt /mnt/.snap/suj28 || continue; } 2>&1 | \ + rm -f $mntpoint/.snap/suj28 + { mksnap_ffs $mntpoint $mntpoint/.snap/suj28 || continue; } 2>&1 | \ grep -v "Resource temporarily unavailable" - [ ! -s /mnt/.snap/suj28 ] && continue - mdconfig -a -t vnode -f /mnt/.snap/suj28 -u $mdstart2 -o readonly + [ ! -s $mntpoint/.snap/suj28 ] && continue + mdconfig -a -t vnode -f $mntpoint/.snap/suj28 -u $mdstart2 -o readonly mount -r /dev/md$mdstart2 $mntpoint2 ls -l $mntpoint2 > /dev/null # Missing "umount $mntpoint2" causing the following mksnap_ffs to loop mdconfig -d -u $mdstart2 done wait while mount | grep $mntpoint2 | grep -q /dev/md; do umount $mntpoint2 || sleep 1 done mdconfig -l | grep -q md$mdstart2 && mdconfig -d -u $mdstart2 while mount | grep "$mntpoint " | grep -q /dev/md; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart Index: user/pho/stress2/misc/suj4.sh =================================================================== --- user/pho/stress2/misc/suj4.sh (revision 318778) +++ user/pho/stress2/misc/suj4.sh (revision 318779) @@ -1,58 +1,58 @@ #!/bin/sh # # Copyright (c) 2010 Peter Holm # 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: projects/stress2/misc/suj.sh 210724 2010-08-01 10:33:03Z pho $ # [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 # "panic: worklist_remove: 0xca821840 jnewblk(0x109) not on list" seen . ../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 1g -u $mdstart bsdlabel -w md$mdstart auto newfs -j md${mdstart}$part > /dev/null mount /dev/md${mdstart}$part $mntpoint chmod 777 $mntpoint export RUNDIR=$mntpoint/stressX export runRUNTIME=30m -set `df -ik /mnt | tail -1 | awk '{print $4,$7}'` +set `df -ik $mntpoint | tail -1 | awk '{print $4,$7}'` export KBLOCKS=$(($1 / 2)) export INODES=$(($2 / 2)) export rwINCARNATIONS=10 export rwHOG=1 su $testuser -c "cd ..; ./run.sh rw.cfg" while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart Index: user/pho/stress2/misc/suj8.sh =================================================================== --- user/pho/stress2/misc/suj8.sh (revision 318778) +++ user/pho/stress2/misc/suj8.sh (revision 318779) @@ -1,61 +1,61 @@ #!/bin/sh # # Copyright (c) 2011 Peter Holm # 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: projects/stress2/misc/suj.sh 210724 2010-08-01 10:33:03Z pho $ # [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 # fsck modifies the fs_time without reason for SU+J, when "disk full" or # "out of inodes" has been reached. . ../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 128M -u $mdstart || exit 1 bsdlabel -w md$mdstart auto n=0 for i in 1 2 ; do n=$((n + 1)) echo "newfs -U md${mdstart}$part" newfs -U md${mdstart}$part > /dev/null [ $n -eq 2 ] && tunefs -j enable /dev/md${mdstart}$part mount /dev/md${mdstart}$part $mntpoint - dd if=/dev/zero of=/mnt/big bs=4k > /dev/null 2>&1 + dd if=/dev/zero of=$mntpoint/big bs=4k > /dev/null 2>&1 while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done checkfs /dev/md${mdstart}$part done mdconfig -d -u $mdstart Index: user/pho/stress2/misc/tmpfs14.sh =================================================================== --- user/pho/stress2/misc/tmpfs14.sh (revision 318778) +++ user/pho/stress2/misc/tmpfs14.sh (revision 318779) @@ -1,114 +1,114 @@ #!/bin/sh # # Copyright (c) 2015 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$ # # Verify that mmap access updates mtime and ctime on files located on a # tmpfs FS. # Fixed by r277828 and r277969. [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg odir=`pwd` cd /tmp sed '1,/^EOF/d' < $odir/$0 > tmpfs14.c rm -f /tmp/tmpfs14 mycc -o tmpfs14 -Wall -Wextra -g -O2 tmpfs14.c || exit 1 rm -f tmpfs14.c cd $odir mount | grep -q "$mntpoint " && umount -f $mntpoint -mount -t tmpfs tmpfs /mnt +mount -t tmpfs tmpfs $mntpoint (cd $mntpoint; /tmp/tmpfs14) & sleep .5 set `stat -f "%m %c" $mntpoint/test` m1=$1 c1=$2 while pgrep -q tmpfs14; do set `stat -f "%m %c" $mntpoint/test` [ "$m1" != "$1" ] && break [ "$c1" != "$2" ] && break sleep 1 done [ "$m1" = "$1" -o "$c1" = "$2" ] && echo "FAIL Unchanged time $m1 $c1 / $1 $2" wait while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done rm -f /tmp/tmpfs14 exit 0 EOF #include #include #include #include #include #include #include #include #include char *file = "test"; int main(void) { char *p; size_t len; int fd, i; if ((fd = open(file, O_RDWR | O_CREAT, 0644)) == -1) err(1, "open(%s)", file); if (write(fd, "abcdef", 7) < 0) err(1, "write"); close(fd); len = getpagesize(); for (i = 0; i < 10; i++) { sleep(1); if ((fd = open(file, O_RDWR | O_CREAT, 0644)) == -1) err(1, "open(%s)", file); if ((p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) err(1, "mmap"); p[0] = '0' + i; munmap(p, len); close(fd); } return 0; } Index: user/pho/stress2/misc/unionfs.sh =================================================================== --- user/pho/stress2/misc/unionfs.sh (revision 318778) +++ user/pho/stress2/misc/unionfs.sh (revision 318779) @@ -1,54 +1,54 @@ #!/bin/sh # # Copyright (c) 2008-2011 Peter Holm # 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 # "insmntque: non-locked vp: 0xd2462e10 is not exclusive locked ..." seen. . ../default.cfg truncate -s 256M $diskimage mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart mdconfig -a -t vnode -f $diskimage -u $mdstart bsdlabel -w md$mdstart auto newfs $newfs_flags md${mdstart}$part > /dev/null mount /dev/md${mdstart}$part $mntpoint -mount -t unionfs -o noatime /mnt /tmp +mount -t unionfs -o noatime $mntpoint /tmp export RUNDIR=/tmp/stressX export runRUNTIME=10m # Run tests for 10 minutes (cd ..; ./run.sh disk.cfg) while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart rm -f $diskimage