Index: user/pho/stress2/misc/gnop.sh =================================================================== --- user/pho/stress2/misc/gnop.sh (revision 317790) +++ user/pho/stress2/misc/gnop.sh (revision 317791) @@ -1,71 +1,71 @@ #!/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$ # [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 # Test with different sector size using gnop(8). # Out of VM seen: # https://people.freebsd.org/~pho/stress/log/gnop.txt test() { . ../default.cfg mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint [ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart mdconfig -a -t swap -s 2g -u $mdstart || exit 1 gnop create -S $1 /dev/md$mdstart - newfs $newfs_flags /dev/md${mdstart}.nop > /dev/null - mount /dev/md${mdstart}.nop $mntpoint + newfs $newfs_flags /dev/md$mdstart.nop > /dev/null + mount /dev/md$mdstart.nop $mntpoint chmod 777 $mntpoint export runRUNTIME=4m export RUNDIR=$mntpoint/stressX su $testuser -c 'cd ..; ./run.sh marcus.cfg' > /dev/null 2>&1 while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done - checkfs /dev/md${mdstart}.nop - gnop destroy /dev/md${mdstart}.nop + checkfs /dev/md$mdstart.nop + gnop destroy /dev/md$mdstart.nop mdconfig -d -u $mdstart } kldstat | grep -q geom_nop || { gnop load 2>/dev/null || exit 0 && notloaded=1; } gnop status || exit 1 for i in 1k 2k 4k 8k; do test $i done [ $notloaded ] && gnop unload exit 0 Index: user/pho/stress2/misc/gnop2.sh =================================================================== --- user/pho/stress2/misc/gnop2.sh (revision 317790) +++ user/pho/stress2/misc/gnop2.sh (revision 317791) @@ -1,81 +1,81 @@ #!/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$ # [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 # "panic: vnode_pager_generic_getpages: sector size 8192 too large" seen # with an 8k sector size: # https://people.freebsd.org/~pho/stress/log/gnop2.txt # Fixed by r307626 . ../default.cfg kldstat | grep -q geom_nop || { gnop load 2>/dev/null || exit 0 && notloaded=1; } dir=/tmp odir=`pwd` cd $dir sed '1,/^EOF/d' < $odir/mmap5.sh > $dir/gnop2.c mycc -o gnop2 -Wall -Wextra gnop2.c || exit 1 rm -f gnop2.c cd $odir test() { . ../default.cfg mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint [ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart mdconfig -a -t swap -s 2g -u $mdstart || exit 1 gnop create -S $1 /dev/md$mdstart - newfs $newfs_flags /dev/md${mdstart}.nop > /dev/null - mount /dev/md${mdstart}.nop $mntpoint + newfs $newfs_flags /dev/md$mdstart.nop > /dev/null + mount /dev/md$mdstart.nop $mntpoint chmod 777 $mntpoint dd if=/dev/zero of=$mntpoint/file bs=1k count=333 2>&1 | \ egrep -v "records|transferred" /tmp/gnop2 $mntpoint/file while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done - gnop destroy /dev/md${mdstart}.nop + gnop destroy /dev/md$mdstart.nop mdconfig -d -u $mdstart } gnop status || exit 1 for i in 1k 2k 4k 8k; do test $i done [ $notloaded ] && gnop unload rm -f /tmp/gnop2 exit 0 Index: user/pho/stress2/misc/gnop3.sh =================================================================== --- user/pho/stress2/misc/gnop3.sh (revision 317790) +++ user/pho/stress2/misc/gnop3.sh (revision 317791) @@ -1,69 +1,69 @@ #!/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$ # [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 # A 8k sector size test. # "panic: run 8 0xfffff80ff3d1e040 invalid" seen during fix development. . ../default.cfg [ $((`sysctl -n vm.swap_total` / 1024 / 1024 / 1024)) -lt 9 ] && exit 0 kldstat | grep -q geom_nop || { gnop load 2>/dev/null || exit 0 && notloaded=1; } gnop status || exit 1 mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint [ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart mdconfig -a -t swap -s 8g -u $mdstart || exit 1 gnop create -S 8k /dev/md$mdstart -newfs $newfs_flags /dev/md${mdstart}.nop > /dev/null -mount /dev/md${mdstart}.nop $mntpoint +newfs $newfs_flags /dev/md$mdstart.nop > /dev/null +mount /dev/md$mdstart.nop $mntpoint chmod 777 $mntpoint cp -a ../../stress2 $mntpoint here=`pwd` cd $mntpoint/stress2/misc export runRUNTIME=20m export RUNDIR=$mntpoint/stressX su $testuser -c 'cd ..; ./run.sh marcus.cfg' cd $here while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done -gnop destroy /dev/md${mdstart}.nop +gnop destroy /dev/md$mdstart.nop mdconfig -d -u $mdstart [ $notloaded ] && gnop unload exit 0 Index: user/pho/stress2/misc/gnop4.sh =================================================================== --- user/pho/stress2/misc/gnop4.sh (revision 317790) +++ user/pho/stress2/misc/gnop4.sh (revision 317791) @@ -1,75 +1,75 @@ #!/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$ # [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 # A 8k sector size test using buildworld. . ../default.cfg gigs=9 [ $((`sysctl -n vm.swap_total` / 1024 / 1024 / 1024)) -lt $gigs ] && exit 0 [ -d /usr/src/sys ] || exit 0 kldstat | grep -q geom_nop || { gnop load 2>/dev/null || exit 0 && notloaded=1; } gnop status || exit 1 mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint [ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart mdconfig -a -t swap -s ${gigs}g -u $mdstart || exit 1 gnop create -S 8k /dev/md$mdstart -newfs $newfs_flags /dev/md${mdstart}.nop > /dev/null -mount /dev/md${mdstart}.nop $mntpoint +newfs $newfs_flags /dev/md$mdstart.nop > /dev/null +mount /dev/md$mdstart.nop $mntpoint chmod 777 $mntpoint start=`date '+%s'` (cd /usr; tar --exclude compile -cf - src) | (cd $mntpoint; tar xf -) cd $mntpoint/src export MAKEOBJDIRPREFIX=$mntpoint/obj p=$((`sysctl -n hw.ncpu`+ 1)) make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 TARGET_ARCH=amd64 \ > /dev/null & e=$((`date '+%s'` - start)) sleep $((15 * 60 - e)) kill $! wait cd / while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done -gnop destroy /dev/md${mdstart}.nop +gnop destroy /dev/md$mdstart.nop mdconfig -d -u $mdstart [ $notloaded ] && gnop unload exit 0 Index: user/pho/stress2/misc/graid1_5.sh =================================================================== --- user/pho/stress2/misc/graid1_5.sh (revision 317790) +++ user/pho/stress2/misc/graid1_5.sh (revision 317791) @@ -1,111 +1,111 @@ #!/bin/sh # # Copyright (c) 2017 Dell EMC Isilon # 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$ # # Mirror tests with gnop(8) errors introduced in 2 out of three partitions. # No problems seen. [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg gmirror load > /dev/null 2>&1 && unload=1 [ -c /dev/mirror/test ] && { gmirror stop test; gmirror destroy test; } old=`sysctl -n kern.geom.mirror.debug` sysctl kern.geom.mirror.debug=-1 | grep -q -- -1 || sysctl kern.geom.mirror.debug=$old > /dev/null kldstat | grep -q geom_nop || { gnop load 2>/dev/null || exit 0; } gnop status || exit 1 u1=$mdstart u2=$((mdstart + 1)) u3=$((mdstart + 2)) s=0 for u in $u1 $u2 $u3; do [ -c /dev/md$u ] && mdconfig -d -u $u mdconfig -a -t swap -s 341m -u $u gpart create -s GPT md$u done > /dev/null set -e ( gpart add -t freebsd-ufs -s 340m md$u1 gpart add -t freebsd-ufs -s 340m md$u2 gpart add -t freebsd-ufs -s 340m md$u3 ) > /dev/null gnop create md$u2 gnop create md$u3 -gmirror label test md${u1}p1 md${u2}.nopp1 md${u3}.nopp1 +gmirror label test md${u1}p1 md$u2.nopp1 md$u3.nopp1 [ -c /dev/mirror/test ] || exit 1 newfs /dev/mirror/test > /dev/null mount /dev/mirror/test $mntpoint set +e chmod 777 $mntpoint export runRUNTIME=5m export RUNDIR=$mntpoint/stressX rm -rf /tmp/stressX.control su $testuser -c 'cd ..; ./run.sh marcus.cfg' > /dev/null 2>&1 & pid=$! -gnop configure -r 0 -w 1 md${u2}.nop -gnop configure -r 0 -w 1 md${u3}.nop +gnop configure -r 0 -w 1 md$u2.nop +gnop configure -r 0 -w 1 md$u3.nop while kill -0 $pid > /dev/null 2>&1; do - if ! gmirror status test | grep -q md${u2}.nopp1; then + if ! gmirror status test | grep -q md$u2.nopp1; then gmirror forget test - gmirror remove test md${u2}.nopp1 2>/dev/null - gmirror insert test md${u2}.nopp1 2>/dev/null + gmirror remove test md$u2.nopp1 2>/dev/null + gmirror insert test md$u2.nopp1 2>/dev/null fi - if ! gmirror status test | grep -q md${u3}.nopp1; then + if ! gmirror status test | grep -q md$u3.nopp1; then gmirror forget test - gmirror remove test md${u3}.nopp1 2>/dev/null - gmirror insert test md${u3}.nopp1 2>/dev/null + gmirror remove test md$u3.nopp1 2>/dev/null + gmirror insert test md$u3.nopp1 2>/dev/null fi sleep 1 done wait while mount | grep $mntpoint | grep -q /mirror/; do umount $mntpoint || sleep 5 done while gmirror status test | grep -q SYNCHRONIZING; do sleep 10; done for i in `jot 10`; do gmirror stop test && break || sleep 30 done [ $i -eq 10 ] && s=1 gmirror destroy test 2>/dev/null [ $unload ] && gmirror unload for u in $u1 $u2 $u3; do mdconfig -d -u $u || s=3 done exit $s Index: user/pho/stress2/misc/maxmemdom.sh =================================================================== --- user/pho/stress2/misc/maxmemdom.sh (revision 317790) +++ user/pho/stress2/misc/maxmemdom.sh (revision 317791) @@ -1,49 +1,49 @@ #!/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$ # # Demonstrate that "options MAXMEMDOM" is broken. (NUMA test) # panic: vm_page_alloc: missing page # https://people.freebsd.org/~pho/stress/log/maxmemdom.txt # Fixed in r293640. . ../default.cfg [ `sysctl -n vm.ndomains` -eq 1 ] && exit 0 size=$((`sysctl -n hw.physmem` / 1024 / 1024)) need=$((size * 2)) -d1=${diskimage}.1 -d2=${diskimage}.2 +d1=$diskimage.1 +d2=$diskimage.2 rm -f $d1 $d2 [ `df -k $(dirname $diskimage) | tail -1 | awk '{print int($4 / 1024)'}` -lt \ $need ] && printf "Need %d MB on %s.\n" $need `dirname $diskimage` && exit dd if=/dev/zero of=$d1 bs=1m count=$size 2>&1 | \ egrep -v "records|transferred" cp $d1 $d2 rm -f $d1 $d2 Index: user/pho/stress2/misc/oovm.sh =================================================================== --- user/pho/stress2/misc/oovm.sh (revision 317790) +++ user/pho/stress2/misc/oovm.sh (revision 317791) @@ -1,137 +1,137 @@ #!/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$ # # Out of VM deadlock seen. Introduced by r285808. # https://people.freebsd.org/~pho/stress/log/oovm.txt # https://people.freebsd.org/~pho/stress/log/oovm-2.txt # Fixed by r290047 and # Test scenario suggestion by alc@ . ../default.cfg [ `swapinfo | wc -l` -eq 1 ] && exit 0 maxsize=$((2 * 1024)) # Limit size due to runtime reasons size=$((`sysctl -n hw.physmem` / 1024 / 1024)) [ $size -gt $((4 * 1024)) ] && echo "RAM should be capped to 4GB for this test." [ $size -gt $maxsize ] && size=$maxsize need=$((size * 2)) -d1=${diskimage}.1 -d2=${diskimage}.2 +d1=$diskimage.1 +d2=$diskimage.2 rm -f $d1 $d2 [ `df -k $(dirname $diskimage) | tail -1 | awk '{print int($4 / 1024)'}` -lt \ $need ] && printf "Need %d MB on %s.\n" $need `dirname $diskimage` && exit dd if=/dev/zero of=$d1 bs=1m count=$size 2>&1 | \ egrep -v "records|transferred" cp $d1 $d2 || exit trap "rm -f $d1 $d2" EXIT INT dir=/tmp odir=`pwd` cd $dir sed '1,/^EOF/d' < $odir/$0 > $dir/oovm.c mycc -o oovm -Wall -Wextra -g oovm.c || exit 1 rm -f oovm.c cd $odir (cd /tmp; /tmp/oovm $d1) & (cd /tmp; /tmp/oovm $d2) & wait rm -f /tmp/oovm /tmp/oovm.core exit EOF #include #include #include #include #include #include #include #include #include #include const char *file; #define RUNTIME 600 void test(void) { struct stat st; size_t i, olen, len; time_t start; int error, fd, ps; char *p; ps = getpagesize(); if ((fd = open(file, O_RDWR)) == -1) err(1, "open(%s)", file); if ((error = fstat(fd, &st)) == -1) err(1, "stat(%s)", file); len = olen = round_page(st.st_size); do { if ((p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) { if (errno == ENOMEM) len -= ps; else err(1, "mmap"); } } while (p == MAP_FAILED); start = time(NULL); /* Touch all pages of the file. */ for (i = 0; i < len; i += ps) p[i] = 1; while (time(NULL) - start < RUNTIME) p[arc4random() % len] = 1; if (munmap(p, len) == -1) err(1, "unmap()"); close(fd); } int main(int argc, char *argv[]) { if (argc != 2) errx(1, "Usage: %s ", argv[0]); file = argv[1]; test(); return (0); } Index: user/pho/stress2/misc/oovm2.sh =================================================================== --- user/pho/stress2/misc/oovm2.sh (revision 317790) +++ user/pho/stress2/misc/oovm2.sh (revision 317791) @@ -1,139 +1,139 @@ #!/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$ # # Out of VM deadlock seen. Introduced by r285808. Variation of oovm.sh # https://people.freebsd.org/~pho/stress/log/oovm2.txt # Fixed by r290047 and # Test scenario suggestion by alc@ . ../default.cfg [ `swapinfo | wc -l` -eq 1 ] && exit 0 maxsize=$((2 * 1024)) # Limit size due to runtime reasons size=$((`sysctl -n hw.physmem` / 1024 / 1024)) [ $size -gt $maxsize ] && size=$maxsize -d1=${diskimage}.1 -d2=${diskimage}.2 -d3=${diskimage}.3 -d4=${diskimage}.4 +d1=$diskimage.1 +d2=$diskimage.2 +d3=$diskimage.3 +d4=$diskimage.4 rm -f $d1 $d2 $d3 $d4 [ `df -k $(dirname $diskimage) | tail -1 | awk '{print int($4 / 1024)'}` -lt \ $size ] && printf "Need %d MB on %s.\n" $size `dirname $diskimage` && exit dd if=/dev/zero of=$d1 bs=1m count=$((size / 4)) 2>&1 | \ egrep -v "records|transferred" cp $d1 $d2 || exit cp $d1 $d3 || exit cp $d1 $d4 || exit trap "rm -f $d1 $d2 $d3 $d4" EXIT INT dir=/tmp odir=`pwd` cd $dir sed '1,/^EOF/d' < $odir/$0 > $dir/oovm2.c mycc -o oovm2 -Wall -Wextra -g oovm2.c || exit 1 rm -f oovm2.c cd $odir (cd /tmp; /tmp/oovm2 $d1) & (cd /tmp; /tmp/oovm2 $d2) & (cd /tmp; /tmp/oovm2 $d3) & (cd /tmp; /tmp/oovm2 $d4) & wait rm -f /tmp/oovm2 /tmp/oovm2.core exit EOF #include #include #include #include #include #include #include #include #include #include const char *file; #define RUNTIME 600 void test(void) { struct stat st; size_t i, olen, len; time_t start; int error, fd, ps; char *p; ps = getpagesize(); if ((fd = open(file, O_RDWR)) == -1) err(1, "open(%s)", file); if ((error = fstat(fd, &st)) == -1) err(1, "stat(%s)", file); len = olen = round_page(st.st_size); do { if ((p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) { if (errno == ENOMEM) len -= ps; else err(1, "mmap"); } } while (p == MAP_FAILED); start = time(NULL); /* Touch all pages of the file. */ for (i = 0; i < len; i += ps) p[i] = 1; while (time(NULL) - start < RUNTIME) p[arc4random() % len] = 1; if (munmap(p, len) == -1) err(1, "unmap()"); close(fd); } int main(int argc, char *argv[]) { if (argc != 2) errx(1, "Usage: %s ", argv[0]); file = argv[1]; test(); return (0); } Index: user/pho/stress2/misc/suj12.sh =================================================================== --- user/pho/stress2/misc/suj12.sh (revision 317790) +++ user/pho/stress2/misc/suj12.sh (revision 317791) @@ -1,59 +1,59 @@ #!/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$ # [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 # Test with different sector size using gnop(8). . ../default.cfg gnop load || exit 0 mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart mdconfig -a -t swap -s 1g -u $mdstart || exit 1 gnop status || exit 1 gnop create -S 4k /dev/md$mdstart -newfs -j /dev/md${mdstart}.nop -mount /dev/md${mdstart}.nop $mntpoint +newfs -j /dev/md$mdstart.nop +mount /dev/md$mdstart.nop $mntpoint chmod 777 $mntpoint export runRUNTIME=20m export RUNDIR=$mntpoint/stressX su $testuser -c 'cd ..; ./run.sh marcus.cfg' while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done -checkfs /dev/md${mdstart}.nop -gnop destroy /dev/md${mdstart}.nop +checkfs /dev/md$mdstart.nop +gnop destroy /dev/md$mdstart.nop gnop unload mdconfig -d -u $mdstart Index: user/pho/stress2/misc/suj3.sh =================================================================== --- user/pho/stress2/misc/suj3.sh (revision 317790) +++ user/pho/stress2/misc/suj3.sh (revision 317791) @@ -1,65 +1,65 @@ #!/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 # Sector size > 512 test. # "panic: Memory modified after free ..." seen. # https://people.freebsd.org/~pho/stress/log/suj3-2.txt . ../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 dd if=/dev/random of=/tmp/suj3.key bs=64 count=1 > /dev/null 2>&1 echo test | geli init -s 4096 -J - -K /tmp/suj3.key /dev/md$mdstart > /dev/null echo test | geli attach -j - -k /tmp/suj3.key /dev/md$mdstart newfs /dev/md$mdstart.eli > /dev/null -tunefs -j enable /dev/md${mdstart}.eli -mount /dev/md${mdstart}.eli $mntpoint +tunefs -j enable /dev/md$mdstart.eli +mount /dev/md$mdstart.eli $mntpoint chmod 777 $mntpoint export RUNDIR=$mntpoint/stressX export runRUNTIME=5m -mount | grep -q md${mdstart}.eli && \ +mount | grep -q md$mdstart.eli && \ su $testuser -c "cd ..; ./run.sh rw.cfg" while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done -checkfs /dev/md${mdstart}.eli +checkfs /dev/md$mdstart.eli geli kill /dev/md$mdstart.eli mdconfig -d -u $mdstart rm -f /tmp/suj3.key Index: user/pho/stress2/misc/vmio.sh =================================================================== --- user/pho/stress2/misc/vmio.sh (revision 317790) +++ user/pho/stress2/misc/vmio.sh (revision 317791) @@ -1,59 +1,59 @@ #!/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$ # # Out of swap seen with no swap disk: # dd 'if=/dev/zero' 'of=/var/tmp/diskimage.1' 'bs=1m' 'count=3427' # pid 598 (ntpd), uid 0, was killed: out of swap space # pid 656 (sendmail), uid 0, was killed: out of swap space # pid 659 (sendmail), uid 25, was killed: out of swap space # https://people.freebsd.org/~pho/stress/log/alan020.txt # Deadlock seen: # https://people.freebsd.org/~pho/stress/log/kostik845.txt # Fixed by r290920. . ../default.cfg [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ `sysctl -n hw.physmem` -gt $(( 8 * 1024 * 1024 * 1024)) ] && exit 0 [ `swapinfo | wc -l` -eq 1 ] || { swapoff -a; off=1; } size=$((`sysctl -n hw.physmem` / 1024 / 1024)) need=$((size * 2)) -d1=${diskimage}.1 -d2=${diskimage}.2 +d1=$diskimage.1 +d2=$diskimage.2 rm -f $d1 $d2 || exit 1 [ `df -k $(dirname $diskimage) | tail -1 | awk '{print int($4 / 1024)'}` \ -lt $need ] && printf "Need %d MB on %s.\n" $need `dirname $diskimage` && exit 0 trap "rm -f $d1 $d2" EXIT INT dd if=/dev/zero of=$d1 bs=1m count=$size 2>&1 | \ egrep -v "records|transferred" cp $d1 $d2 [ $off ] && swapon -a Index: user/pho/stress2/misc/zfs2.sh =================================================================== --- user/pho/stress2/misc/zfs2.sh (revision 317790) +++ user/pho/stress2/misc/zfs2.sh (revision 317791) @@ -1,72 +1,72 @@ #!/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$ # # Simple zfs mirror test scenario [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ `sysctl -n kern.kstack_pages` -lt 4 ] && exit 0 . ../default.cfg kldstat -v | grep -q zfs.ko || { kldload zfs.ko || exit 0; loaded=1; } -d1=${diskimage}.1 -d2=${diskimage}.2 +d1=$diskimage.1 +d2=$diskimage.2 dd if=/dev/zero of=$d1 bs=1m count=1k 2>&1 | egrep -v "records|transferred" dd if=/dev/zero of=$d2 bs=1m count=1k 2>&1 | egrep -v "records|transferred" u1=$mdstart u2=$((u1 + 1)) mdconfig -l | grep -q md$u1 && mdconfig -d -u $u1 mdconfig -l | grep -q md$u2 && mdconfig -d -u $u2 mdconfig -a -t vnode -f $d1 -u $u1 mdconfig -a -t vnode -f $d2 -u $u2 zpool list | egrep -q "^tank" && zpool destroy tank [ -d /tank ] && rm -rf /tank zpool create tank mirror md$u1 md$u2 export RUNDIR=/tank/stressX export runRUNTIME=10m (cd ..; ./run.sh marcus.cfg) zfs destroy -r tank zpool destroy tank mdconfig -d -u $u1 mdconfig -d -u $u2 rm -rf $d1 $d2 [ -n "$loaded" ] && kldunload zfs.ko exit 0 Index: user/pho/stress2/misc/zfs3.sh =================================================================== --- user/pho/stress2/misc/zfs3.sh (revision 317790) +++ user/pho/stress2/misc/zfs3.sh (revision 317791) @@ -1,84 +1,84 @@ #!/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$ # # Simple zfs snapshot test scenario # page fault from fs/zfs/dbuf.c:1807 # Page fault seen: # https://people.freebsd.org/~pho/stress/log/zfs3-2.txt # Fixed in r308887. [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ `sysctl -n kern.kstack_pages` -lt 4 ] && exit 0 . ../default.cfg kldstat -v | grep -q zfs.ko || { kldload zfs.ko || exit 0; loaded=1; } -d1=${diskimage}.1 -d2=${diskimage}.2 +d1=$diskimage.1 +d2=$diskimage.2 dd if=/dev/zero of=$d1 bs=1m count=1k 2>&1 | egrep -v "records|transferred" dd if=/dev/zero of=$d2 bs=1m count=1k 2>&1 | egrep -v "records|transferred" u1=$mdstart u2=$((u1 + 1)) mdconfig -l | grep -q md$u1 && mdconfig -d -u $u1 mdconfig -l | grep -q md$u2 && mdconfig -d -u $u2 mdconfig -a -t vnode -f $d1 -u $u1 mdconfig -a -t vnode -f $d2 -u $u2 zpool list | egrep -q "^tank" && zpool destroy tank [ -d /tank ] && rm -rf /tank zpool create tank md$u1 md$u2 zfs create tank/test zfs set quota=800m tank/test zfs snapshot tank/test@snap1 export RUNDIR=/tank/test/stressX export runRUNTIME=10m (cd ..; ./run.sh marcus.cfg) zfs rollback tank/test@snap1 zfs destroy tank/test@snap1 zfs destroy -r tank zpool destroy tank mdconfig -d -u $u1 mdconfig -d -u $u2 rm -rf $d1 $d2 [ -n "$loaded" ] && kldunload zfs.ko exit 0 Index: user/pho/stress2/misc/zfs4.sh =================================================================== --- user/pho/stress2/misc/zfs4.sh (revision 317790) +++ user/pho/stress2/misc/zfs4.sh (revision 317791) @@ -1,83 +1,83 @@ #!/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$ # # Simple zfs snapshot test scenario [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ `sysctl -n kern.kstack_pages` -lt 4 ] && exit 0 . ../default.cfg kldstat -v | grep -q zfs.ko || { kldload zfs.ko || exit 0; loaded=1; } -d1=${diskimage}.1 -d2=${diskimage}.2 +d1=$diskimage.1 +d2=$diskimage.2 dd if=/dev/zero of=$d1 bs=1m count=1k 2>&1 | egrep -v "records|transferred" dd if=/dev/zero of=$d2 bs=1m count=1k 2>&1 | egrep -v "records|transferred" u1=$mdstart u2=$((u1 + 1)) mdconfig -l | grep -q md$u1 && mdconfig -d -u $u1 mdconfig -l | grep -q md$u2 && mdconfig -d -u $u2 mdconfig -a -t vnode -f $d1 -u $u1 mdconfig -a -t vnode -f $d2 -u $u2 zpool list | egrep -q "^tank" && zpool destroy tank [ -d /tank ] && rm -rf /tank zpool create tank md$u1 md$u2 zfs create tank/test zfs set quota=100m tank/test zfs set snapdir=visible tank/test export RUNDIR=/tank/test/stressX export runRUNTIME=10m (cd ..; ./run.sh marcus.cfg) & for i in `jot 20`; do zfs snapshot tank/test@snap$i done for i in `jot 20`; do zfs destroy tank/test@snap$i done wait zfs destroy -r tank zpool destroy tank mdconfig -d -u $u1 mdconfig -d -u $u2 rm -rf $d1 $d2 [ -n "$loaded" ] && kldunload zfs.ko exit 0 Index: user/pho/stress2/misc/zfs5.sh =================================================================== --- user/pho/stress2/misc/zfs5.sh (revision 317790) +++ user/pho/stress2/misc/zfs5.sh (revision 317791) @@ -1,72 +1,72 @@ #!/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$ # # Simple zfs test of vdev as a file and snapshot clones [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ `sysctl -n kern.kstack_pages` -lt 4 ] && exit 0 . ../default.cfg kldstat -v | grep -q zfs.ko || { kldload zfs.ko || exit 0; loaded=1; } -d1=${diskimage}.1 -d2=${diskimage}.2 +d1=$diskimage.1 +d2=$diskimage.2 dd if=/dev/zero of=$d1 bs=1m count=1k 2>&1 | egrep -v "records|transferred" dd if=/dev/zero of=$d2 bs=1m count=1k 2>&1 | egrep -v "records|transferred" zpool list | egrep -q "^tank" && zpool destroy tank [ -d /tank ] && rm -rf /tank zpool create tank $d1 $d2 zfs create tank/test zfs set quota=100m tank/test export RUNDIR=/tank/test/stressX export runRUNTIME=10m (cd ..; ./run.sh vfs.cfg) & for i in `jot 20`; do zfs snapshot tank/test@snap$i zfs clone tank/test@snap$i tank/snap$i done for i in `jot 20`; do zfs destroy tank/snap$i zfs destroy tank/test@snap$i done wait zfs destroy -r tank zpool destroy tank rm -rf $d1 $d2 [ -n "$loaded" ] && kldunload zfs.ko exit 0