Index: user/pho/stress2/misc/quota1.sh =================================================================== --- user/pho/stress2/misc/quota1.sh (revision 317400) +++ user/pho/stress2/misc/quota1.sh (revision 317401) @@ -1,56 +1,59 @@ #!/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 # 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 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 bsdlabel -w md$mdstart auto newfs $newfs_flags md${mdstart}$part > /dev/null mount /dev/md${mdstart}$part $mntpoint export RUNDIR=${mntpoint}/stressX export runRUNTIME=10m # Run tests for 10 minutes (cd ..; ./run.sh disk.cfg) while mount | grep -q $mntpoint; do umount $mntpoint > /dev/null 2>&1 || sleep 1 done mdconfig -d -u $mdstart rm -f $D +exit 0 Index: user/pho/stress2/misc/quota10.sh =================================================================== --- user/pho/stress2/misc/quota10.sh (revision 317400) +++ user/pho/stress2/misc/quota10.sh (revision 317401) @@ -1,98 +1,106 @@ #!/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$ # # 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 mounts=15 # Number of parallel scripts mdstart=$mdstart # Use md unit numbers from this point D=$diskimage 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 # 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 rm -f $PATH_FSTAB else if [ $1 = find ]; then while [ -r /tmp/$0 ]; do ( quotaon ${mntpoint}$2 quotaoff ${mntpoint}$2 ) 2>&1 | egrep -v "No such file or directory" done else # The test: Parallel mount and unmounts for i in `jot 200`; do m=$1 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 Index: user/pho/stress2/misc/quota11.sh =================================================================== --- user/pho/stress2/misc/quota11.sh (revision 317400) +++ user/pho/stress2/misc/quota11.sh (revision 317401) @@ -1,64 +1,69 @@ #!/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$ # # "panic: share->excl" seen. # http://people.freebsd.org/~pho/stress/log/kostik715.txt # Fixed in r270795 and r270797 # Test scenario by Hiroki Sato [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0 . ../default.cfg mount | grep "on $mntpoint " | grep -q md${mdstart}$part && umount $mntpoint [ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart mdconfig -a -t swap -s 1g -u $mdstart || exit 1 bsdlabel -w md$mdstart auto newfs $newfs_flags md${mdstart}$part > /dev/null export PATH_FSTAB=/tmp/fstab trap "rm -f $PATH_FSTAB" 0 echo "/dev/md${mdstart}$part $mntpoint ufs rw,userquota 2 2" > $PATH_FSTAB mount $mntpoint edquota -u -f $mntpoint -e $mntpoint:1000:2000:100:200 root quotaon $mntpoint while true; do repquota -av > /dev/null; done & dd if=/dev/random of=$mntpoint/foo.data bs=512 count=1024x1024 2>&1 | egrep -v "trans|record" 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 Index: user/pho/stress2/misc/quota2.sh =================================================================== --- user/pho/stress2/misc/quota2.sh (revision 317400) +++ user/pho/stress2/misc/quota2.sh (revision 317401) @@ -1,57 +1,59 @@ #!/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 +[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0 . ../default.cfg D=$diskimage export PATH_FSTAB=/tmp/fstab trap "rm -f $D $PATH_FSTAB" 0 dede $D 1m 128 || exit 1 mount | grep "$mntpoint" | grep md${mdstart}$part > /dev/null && umount $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" > $PATH_FSTAB mount ${mntpoint} edquota -u -f $mntpoint -e $mntpoint:100000:110000:15000:16000 root 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 Index: user/pho/stress2/misc/quota3.sh =================================================================== --- user/pho/stress2/misc/quota3.sh (revision 317400) +++ user/pho/stress2/misc/quota3.sh (revision 317401) @@ -1,58 +1,59 @@ #!/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 +[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0 . ../default.cfg D=$diskimage export PATH_FSTAB=/tmp/fstab trap "rm -f $D $PATH_FSTAB" 0 dede $D 1m 1k || exit 1 mount | grep "${mntpoint}" | grep -q md${mdstart}$part && 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" > $PATH_FSTAB mount ${mntpoint} edquota -u -f $mntpoint -e $mntpoint:850000:900000:130000:140000 root quotacheck $mntpoint quotaon $mntpoint mksnap_ffs $mntpoint $mntpoint/.snap/stress2 export RUNDIR=$mntpoint/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 Index: user/pho/stress2/misc/quota4.sh =================================================================== --- user/pho/stress2/misc/quota4.sh (revision 317400) +++ user/pho/stress2/misc/quota4.sh (revision 317401) @@ -1,61 +1,67 @@ #!/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$ # [ `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 . ../default.cfg 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 Index: user/pho/stress2/misc/quota5.sh =================================================================== --- user/pho/stress2/misc/quota5.sh (revision 317400) +++ user/pho/stress2/misc/quota5.sh (revision 317401) @@ -1,45 +1,46 @@ #!/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 +[ "`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 echo "/tmp must have quota enabled!" exit 0 fi edquota -u -f /tmp -e /tmp:1500000:1400000:200000:180000 $testuser edquota -g -f /tmp -e /tmp:1500000:1400000:200000:180000 $testuser quotaon /tmp su $testuser -c "export runRUNTIME=60m; cd ../testcases/mkdir; \ ./mkdir -t 30m -i 200 -v -v" quotaoff /tmp Index: user/pho/stress2/misc/quota6.sh =================================================================== --- user/pho/stress2/misc/quota6.sh (revision 317400) +++ user/pho/stress2/misc/quota6.sh (revision 317401) @@ -1,67 +1,71 @@ #!/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$ # [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +[ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0 . ../default.cfg # Deadlock in umount(1) while out of disk space D=$diskimage truncate -s 250M $D mount | grep $mntpoint | grep -q md${mdstart}$part && umount $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 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 & pid=$! for i in `jot 5`; do echo "`date '+%T'` mksnap_ffs $mntpoint $mntpoint/.snap/snap$i" mksnap_ffs $mntpoint $mntpoint/.snap/snap$i done for i in `jot 5`; do rm -f $mntpoint/.snap/snap1 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 Index: user/pho/stress2/misc/quota7.sh =================================================================== --- user/pho/stress2/misc/quota7.sh (revision 317400) +++ user/pho/stress2/misc/quota7.sh (revision 317401) @@ -1,80 +1,81 @@ #!/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$ # # Quota / snapshot test scenario by Kris@ # 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 D=$diskimage trap "rm -f $D" 0 dd if=/dev/zero of=$D bs=1m count=1k 2>&1 | egrep -v "records|transferred" 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 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)) export INODES=$(($2 / 21)) export HOG=1 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 export RUNDIR=$mntpoint/stressX mkdir $mntpoint/stressX chmod 777 $mntpoint/stressX rm -rf /tmp/stressX.control/* su $testuser -c "(cd ..;runRUNTIME=30m ./run.sh disk.cfg)"& # panic: vfs_allocate_syncvnode: insmntque failed for i in `jot 20`; do 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)) 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 Index: user/pho/stress2/misc/quota8.sh =================================================================== --- user/pho/stress2/misc/quota8.sh (revision 317400) +++ user/pho/stress2/misc/quota8.sh (revision 317401) @@ -1,80 +1,91 @@ #!/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$ # # 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 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 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 Index: user/pho/stress2/misc/quota9.sh =================================================================== --- user/pho/stress2/misc/quota9.sh (revision 317400) +++ user/pho/stress2/misc/quota9.sh (revision 317401) @@ -1,94 +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} - 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} + 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 Index: user/pho/stress2/misc/suj18.sh =================================================================== --- user/pho/stress2/misc/suj18.sh (revision 317400) +++ user/pho/stress2/misc/suj18.sh (revision 317401) @@ -1,66 +1,70 @@ #!/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$ # # SUJ and quota test scenario. # "panic: check_inode_unwritten: busy inode" seen. # Deadlock seen: # https://people.freebsd.org/~pho/stress/log/suj18.txt # 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 Index: user/pho/stress2/misc/suj19.sh =================================================================== --- user/pho/stress2/misc/suj19.sh (revision 317400) +++ user/pho/stress2/misc/suj19.sh (revision 317401) @@ -1,78 +1,79 @@ #!/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$ # # 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 snap () { for i in `jot 5`; do mksnap_ffs $1 $2 2>&1 | grep -v "Resource temporarily unavailable" [ ! -s $2 ] && rm -f $2 || return 0 sleep 1 done return 1 } 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 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}'` export QK=$(($1 / 4)) export QI=$(($2 / 4)) 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)"' & for i in `jot 20`; do echo "`date '+%T'` mksnap_ffs ${mntpoint} ${mntpoint}/.snap/snap$i" snap ${mntpoint} ${mntpoint}/.snap/snap$i || break sleep 1 done i=$(($(date '+%S') % 20 + 1)) echo "rm -f ${mntpoint}/.snap/snap$i" rm -f ${mntpoint}/.snap/snap$i wait while mount | grep -q ${mntpoint}; do umount ${mntpoint} || sleep 1 done mdconfig -d -u ${mdstart} rm -f $PATH_FSTAB