Index: user/pho/stress2/misc/snap.sh =================================================================== --- user/pho/stress2/misc/snap.sh (revision 278902) +++ user/pho/stress2/misc/snap.sh (revision 278903) @@ -1,56 +1,56 @@ #!/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 . ../default.cfg -mount | grep -q "on /tmp " || exit 0 +mount | grep -q "on /tmp (ufs," || exit 0 mount | grep -q "/dev/md$mdstart on $mntpoint" && umount $mntpoint -rm -f /tmp/.snap/pho -trap "rm -f /tmp/.snap/pho" 0 +rm -f /tmp/.snap/stress2 +trap "rm -f /tmp/.snap/stress2" 0 for i in `jot 2`; do - mksnap_ffs /tmp /tmp/.snap/pho - mdconfig -a -t vnode -f /tmp/.snap/pho -u $mdstart -o readonly + mksnap_ffs /tmp /tmp/.snap/stress2 + mdconfig -a -t vnode -f /tmp/.snap/stress2 -u $mdstart -o readonly mount -r /dev/md$mdstart $mntpoint ls -l $mntpoint > /dev/null umount $mntpoint mdconfig -d -u $mdstart - rm -f /tmp/.snap/pho + rm -f /tmp/.snap/stress2 done for i in `jot 2`; do - mksnap_ffs /tmp /tmp/.snap/pho - rm -f /tmp/.snap/pho + mksnap_ffs /tmp /tmp/.snap/stress2 + rm -f /tmp/.snap/stress2 done Index: user/pho/stress2/misc/snap2-1.sh =================================================================== --- user/pho/stress2/misc/snap2-1.sh (revision 278902) +++ user/pho/stress2/misc/snap2-1.sh (revision 278903) @@ -1,61 +1,61 @@ #!/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 . ../default.cfg # Regression test: Delete an active md device # # panic(c088cd33,deadc000,c0943aa0,0,c08753e1) at panic+0x14b # vm_fault(c1060000,deadc000,1,0,c54de480) at vm_fault+0x1e0 # trap_pfault(e76728b8,0,deadc112) at trap_pfault+0x137 # trap(8,c0870028,28,deadc0de,deadc0de) at trap+0x355 # calltrap() at calltrap+0x5 # --- trap 0xc, eip = 0xc060bcfb, esp = 0xe76728f8, ebp = 0xe767291c --- # g_io_request(c53ff7bc,c5051d40,d8c72408,c54ca110,e7672950) at g_io_request+0x5f -mount | grep -q "on /tmp " || exit 0 -rm -f /tmp/.snap/pho +mount | grep -q "on /tmp (ufs," || exit 0 +rm -f /tmp/.snap/stress2 [ -d /tmp/.snap ] || mkdir /tmp/.snap -trap "rm -f /tmp/.snap/pho" 0 +trap "rm -f /tmp/.snap/stress2" 0 mount | grep "$mntpoint" | grep -q md$mdstart && umount $mntpoint mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart -mksnap_ffs /tmp /tmp/.snap/pho -mdconfig -a -t vnode -o readonly -f /tmp/.snap/pho -u $mdstart +mksnap_ffs /tmp /tmp/.snap/stress2 +mdconfig -a -t vnode -o readonly -f /tmp/.snap/stress2 -u $mdstart mount -o ro /dev/md$mdstart $mntpoint ls -lR $mntpoint > /dev/null 2>&1 & mdconfig -d -u $mdstart > /dev/null 2>&1 umount -f $mntpoint mdconfig -d -u $mdstart -rm -f /tmp/.snap/pho +rm -f /tmp/.snap/stress2 Index: user/pho/stress2/misc/snap2.sh =================================================================== --- user/pho/stress2/misc/snap2.sh (revision 278902) +++ user/pho/stress2/misc/snap2.sh (revision 278903) @@ -1,61 +1,61 @@ #!/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 # Regression test: Delete an active md device # # panic(c088cd33,deadc000,c0943aa0,0,c08753e1) at panic+0x14b # vm_fault(c1060000,deadc000,1,0,c54de480) at vm_fault+0x1e0 # trap_pfault(e76728b8,0,deadc112) at trap_pfault+0x137 # trap(8,c0870028,28,deadc0de,deadc0de) at trap+0x355 # calltrap() at calltrap+0x5 # --- trap 0xc, eip = 0xc060bcfb, esp = 0xe76728f8, ebp = 0xe767291c --- # g_io_request(c53ff7bc,c5051d40,d8c72408,c54ca110,e7672950) at g_io_request+0x5f . ../default.cfg -mount | grep -q "on /tmp " || exit 0 -rm -f /tmp/.snap/pho -trap "rm -f /tmp/.snap/pho" 0 +mount | grep -q "on /tmp (ufs," || exit 0 +rm -f /tmp/.snap/stress2 +trap "rm -f /tmp/.snap/stress2" 0 mount | grep "${mntpoint}" | grep -q md${mdstart} && umount -f ${mntpoint} mdconfig -l | grep -q md${mdstart} && mdconfig -d -u ${mdstart} -mksnap_ffs /tmp /tmp/.snap/pho -mdconfig -a -t vnode -f /tmp/.snap/pho -u $mdstart -o readonly +mksnap_ffs /tmp /tmp/.snap/stress2 +mdconfig -a -t vnode -f /tmp/.snap/stress2 -u $mdstart -o readonly mount -r /dev/md${mdstart} ${mntpoint} ls -lR > /dev/null 2>&1 & mdconfig -d -u $mdstart > /dev/null 2>&1 umount ${mntpoint} > /dev/null 2>&1 umount -f ${mntpoint} > /dev/null 2>&1 mdconfig -d -u $mdstart -rm -f /tmp/.snap/pho +rm -f /tmp/.snap/stress2 Index: user/pho/stress2/misc/snap3.sh =================================================================== --- user/pho/stress2/misc/snap3.sh (revision 278902) +++ user/pho/stress2/misc/snap3.sh (revision 278903) @@ -1,64 +1,64 @@ #!/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 . ../default.cfg # Test with two snapshots # 20070506 Page fault in g_io_request+0x7f -mount | grep -q "on /tmp " || exit 0 -rm -f /tmp/.snap/pho.1 -rm -f /tmp/.snap/pho.2 -trap "rm -f /tmp/.snap/pho.?" 0 +mount | grep -q "on /tmp (ufs," || exit 0 +rm -f /tmp/.snap/stress2.1 +rm -f /tmp/.snap/stress2.2 +trap "rm -f /tmp/.snap/stress2.?" 0 mount | grep $mntpoint | grep -q md && umount $mntpoint m1=$mdstart m2=$((m1 + 1)) mdconfig -l | grep -q md$m1 && mdconfig -d -u $m1 mdconfig -l | grep -q md$m2 && mdconfig -d -u $m2 start=`date '+%s'` while [ `date '+%s'` -lt $((start + 1800)) ]; do - mksnap_ffs /tmp /tmp/.snap/pho.1 - mksnap_ffs /tmp /tmp/.snap/pho.2 - if [ -r /tmp/.snap/pho.1 -a -r /tmp/.snap/pho.2 ]; then - mdconfig -a -t vnode -f /tmp/.snap/pho.1 -u $m1 -o readonly - mdconfig -a -t vnode -f /tmp/.snap/pho.2 -u $m2 -o readonly + mksnap_ffs /tmp /tmp/.snap/stress2.1 + mksnap_ffs /tmp /tmp/.snap/stress2.2 + if [ -r /tmp/.snap/stress2.1 -a -r /tmp/.snap/stress2.2 ]; then + mdconfig -a -t vnode -f /tmp/.snap/stress2.1 -u $m1 -o readonly + mdconfig -a -t vnode -f /tmp/.snap/stress2.2 -u $m2 -o readonly mount -o ro /dev/md$m1 $mntpoint sleep 3 umount $mntpoint mdconfig -d -u $m1 mdconfig -d -u $m2 fi - rm -f /tmp/.snap/pho.1 /tmp/.snap/pho.2 + rm -f /tmp/.snap/stress2.1 /tmp/.snap/stress2.2 done Index: user/pho/stress2/misc/snap4.sh =================================================================== --- user/pho/stress2/misc/snap4.sh (revision 278902) +++ user/pho/stress2/misc/snap4.sh (revision 278903) @@ -1,56 +1,56 @@ #!/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 # Test with snapshot file unlinked before unmount . ../default.cfg -mount | grep -q "on /tmp " || exit 0 +mount | grep -q "on /tmp (ufs," || exit 0 mount | grep -q "/dev/md$mdstart on $mntpoint" && umount $mntpoint mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart -rm -f /tmp/.snap/pho -trap "rm -f /tmp/.snap/pho" 0 +rm -f /tmp/.snap/stress2 +trap "rm -f /tmp/.snap/stress2" 0 start=`date '+%s'` while [ `date '+%s'` -lt $((start + 1800)) ]; do - mksnap_ffs /tmp /tmp/.snap/pho - mdconfig -a -t vnode -f /tmp/.snap/pho -u $mdstart -o readonly + mksnap_ffs /tmp /tmp/.snap/stress2 + mdconfig -a -t vnode -f /tmp/.snap/stress2 -u $mdstart -o readonly mount -o ro /dev/md$mdstart $mntpoint ls -l $mntpoint > /dev/null - rm -f /tmp/.snap/pho + rm -f /tmp/.snap/stress2 sleep 1 umount $mntpoint mdconfig -d -u $mdstart - rm -f /tmp/.snap/pho + rm -f /tmp/.snap/stress2 done Index: user/pho/stress2/misc/snap5-1.sh =================================================================== --- user/pho/stress2/misc/snap5-1.sh (revision 278902) +++ user/pho/stress2/misc/snap5-1.sh (revision 278903) @@ -1,60 +1,61 @@ #!/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 . ../default.cfg -mount | grep -q "on /tmp " || exit 0 +mount | grep -q "on /tmp (ufs," || exit 0 mnt2=${mntpoint}2 [ ! -d $mnt2 ] && mkdir $mnt2 -trap "rm -f /tmp/.snap/pho" 0 +trap "rm -f /tmp/.snap/stress2" 0 start=`date '+%s'` while [ `date '+%s'` -lt $((start + 1800)) ]; do if mount | grep -q "/dev/md$mdstart on $mnt2"; then umount $mnt2 || exit 2 fi if mdconfig -l | grep -q md$mdstart; then mdconfig -d -u $mdstart || exit 3 fi - rm -f /tmp/.snap/pho + rm -f /tmp/.snap/stress2 date '+%T' - mksnap_ffs /tmp /tmp/.snap/pho || continue - mdconfig -a -t vnode -f /tmp/.snap/pho -u $mdstart -o readonly || exit 4 + mksnap_ffs /tmp /tmp/.snap/stress2 || continue + mdconfig -a -t vnode -f /tmp/.snap/stress2 -u $mdstart -o readonly || + exit 4 mount -o ro /dev/md$mdstart $mnt2 || exit 5 ls -l $mnt2 > /dev/null - r=`head -c4 /dev/urandom | od -N2 -tu4 | sed -ne '1s/ *$//;1s/.* //p'` + r=`head -c4 /dev/random | od -N2 -tu4 | sed -ne '1s/ *$//;1s/.* //p'` sleep $(( r % 120 )) done mount | grep -q "/dev/md$mdstart on $mnt2" && umount $mnt2 mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart Index: user/pho/stress2/misc/snap5.sh =================================================================== --- user/pho/stress2/misc/snap5.sh (revision 278902) +++ user/pho/stress2/misc/snap5.sh (revision 278903) @@ -1,57 +1,57 @@ #!/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 . ../default.cfg -mount | grep -q "on /tmp " || exit 0 +mount | grep -q "on /tmp (ufs," || exit 0 mnt2=${mntpoint}2 [ ! -d $mnt2 ] && mkdir $mnt2 mount | grep -q "/dev/md$mdstart on $mnt2" && umount $mnt2 mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart -rm -f /tmp/.snap/pho -trap "rm -f /tmp/.snap/pho" 0 +rm -f /tmp/.snap/stress2 +trap "rm -f /tmp/.snap/stress2" 0 start=`date '+%s'` while [ `date '+%s'` -lt $((start + 1800)) ]; do date '+%T' - mksnap_ffs /tmp /tmp/.snap/pho - mdconfig -a -t vnode -f /tmp/.snap/pho -u $mdstart -o readonly + mksnap_ffs /tmp /tmp/.snap/stress2 + mdconfig -a -t vnode -f /tmp/.snap/stress2 -u $mdstart -o readonly mount -o ro /dev/md$mdstart $mnt2 ls -l $mnt2 > /dev/null - r=`head -c4 /dev/urandom | od -N2 -tu4 | sed -ne '1s/ *$//;1s/.* //p'` + r=`head -c4 /dev/random | od -N2 -tu4 | sed -ne '1s/ *$//;1s/.* //p'` sleep $(( r % 120 )) umount $mnt2 mdconfig -d -u $mdstart - rm -f /tmp/.snap/pho + rm -f /tmp/.snap/stress2 done Index: user/pho/stress2/misc/snap6.sh =================================================================== --- user/pho/stress2/misc/snap6.sh (revision 278902) +++ user/pho/stress2/misc/snap6.sh (revision 278903) @@ -1,45 +1,45 @@ #!/bin/sh # Problem Report kern/92272 : [ffs] [hang] Filling a filesystem while creating # a snapshot on it locks the system # John Kozubik # If a filesystem is completely full (approaching 110% in `df` output on # most systems), mksnap_ffs will refuse to begin a snapshot for that reason. # There seem to be no negative consequences. # However, if the filesystem is not quite completely full, mksnap_ffs will # (correctly) begin creating the snapshot as expected. If, during the course # of snapshot creation, the filesystem being snapshotted becomes full, # mksnap_ffs will exit with an error exactly as it does if it is started on # an already full filesystem. # However, several hours later, the system will lock up completely. It still # responds to pings, and open connections to and from it remain in that # state, but they cannot be used and new connections cannot be established. # *** This script does not provoke the problem. *** [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 root=/var -mount | grep -q "on /var " || exit 0 -rm -f $root/.snap/pho $root/big $root/big2 -trap "rm -f $root/.snap/pho $root/big $root/big2" 0 +mount | grep -q "on /var (ufs," || exit 0 +rm -f $root/.snap/stress2 $root/big $root/big2 +trap "rm -f $root/.snap/stress2 $root/big $root/big2" 0 free=`df $root | tail -1 | awk '{print $4}'` dd if=/dev/zero of=$root/big bs=1m count=$(( free / 1024 - 90)) > /dev/null 2>&1 df $root for i in `jot 1024`; do date - nice -20 mksnap_ffs $root $root/.snap/pho & + nice -20 mksnap_ffs $root $root/.snap/stress2 & dd if=/dev/zero of=$root/big2 bs=1m > /dev/null 2>&1 wait - [ -f $root/.snap/pho ] && exit 0 - rm -f $root/.snap/pho $root/big2 + [ -f $root/.snap/stress2 ] && exit 0 + rm -f $root/.snap/stress2 $root/big2 done df $root -rm -f $root/.snap/pho $root/big $root/big2 +rm -f $root/.snap/stress2 $root/big $root/big2 Index: user/pho/stress2/misc/snap7.sh =================================================================== --- user/pho/stress2/misc/snap7.sh (revision 278902) +++ user/pho/stress2/misc/snap7.sh (revision 278903) @@ -1,57 +1,57 @@ #!/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 . ../default.cfg # Test with unmount and paralless access to mountpoint # 20070508 page fault in g_io_request+0xa6 -mount | grep -q "on /tmp " || exit 0 +mount | grep -q "on /tmp (ufs," || exit 0 mount | grep -q "/dev/md$mdstart on $mntpoint" && umount $mntpoint -rm -f /tmp/.snap/pho.1 -trap "rm -f /tmp/.snap/pho.1" 0 +rm -f /tmp/.snap/stress2.1 +trap "rm -f /tmp/.snap/stress2.1" 0 mount | grep "$mntpoint" | grep -q md$mdstart && umount $mntpoint mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart start=`date '+%s'` while [ `date '+%s'` -lt $((start + 1800)) ]; do - mksnap_ffs /tmp /tmp/.snap/pho.1 - mdconfig -a -t vnode -f /tmp/.snap/pho.1 -u $mdstart -o readonly + mksnap_ffs /tmp /tmp/.snap/stress2.1 + mdconfig -a -t vnode -f /tmp/.snap/stress2.1 -u $mdstart -o readonly sh -c "while true; do ls $mntpoint > /dev/null;done" & for i in `jot 64`; do - mount -o ro /dev/md$mdstart $mntpoint - umount $mntpoint + mount -o ro /dev/md$mdstart $mntpoint 2>/dev/null + umount $mntpoint 2>/dev/null done kill $! mdconfig -d -u $mdstart - rm -f /tmp/.snap/pho.1 + rm -f /tmp/.snap/stress2.1 done Index: user/pho/stress2/misc/snap9.sh =================================================================== --- user/pho/stress2/misc/snap9.sh (nonexistent) +++ user/pho/stress2/misc/snap9.sh (revision 278903) @@ -0,0 +1,70 @@ +#!/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 + +exit 0 # Waiting for fix. Still an issue @ 20150217 + +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 +done +mdconfig -d -u $mdstart Property changes on: user/pho/stress2/misc/snap9.sh ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property