1*c2b51333SPeter Holm#!/bin/sh 2*c2b51333SPeter Holm 3*c2b51333SPeter Holm# "panic: unionfs_lock_lvp: vnode is locked but should not be" seen 4*c2b51333SPeter Holm 5*c2b51333SPeter Holm# Test scenario based on: 6*c2b51333SPeter Holm# Bug 275871 - [unionfs] [nullfs] [zfs] corrupt filesystem 7*c2b51333SPeter Holm# Bug 172334 - unionfs permits recursive union mounts; causes panic quickly 8*c2b51333SPeter Holm 9*c2b51333SPeter Holm. ../default.cfg 10*c2b51333SPeter Holm 11*c2b51333SPeter Holmprog=$(basename "$0" .sh) 12*c2b51333SPeter Holmhere=`pwd` 13*c2b51333SPeter Holmlog=/tmp/$prog.log 14*c2b51333SPeter Holmmd1=$mdstart 15*c2b51333SPeter Holmmd2=$((md1 + 1)) 16*c2b51333SPeter Holmmp1=/mnt$md1 17*c2b51333SPeter Holmmp2=/mnt$md2 18*c2b51333SPeter Holm 19*c2b51333SPeter Holmset -eu 20*c2b51333SPeter Holmmdconfig -l | grep -q md$md1 && mdconfig -d -u $md1 21*c2b51333SPeter Holmmdconfig -l | grep -q md$md2 && mdconfig -d -u $md2 22*c2b51333SPeter Holm 23*c2b51333SPeter Holmmdconfig -s 2g -u $md1 24*c2b51333SPeter Holmnewfs $newfs_flags /dev/md$md1 > /dev/null 25*c2b51333SPeter Holmmdconfig -s 2g -u $md2 26*c2b51333SPeter Holmnewfs $newfs_flags /dev/md$md2 > /dev/null 27*c2b51333SPeter Holm 28*c2b51333SPeter Holmmkdir -p $mp1 $mp2 29*c2b51333SPeter Holmmount /dev/md$md1 $mp1 30*c2b51333SPeter Holmmount /dev/md$md2 $mp2 31*c2b51333SPeter Holmset +e 32*c2b51333SPeter Holmmount -t unionfs -o noatime $mp1 $mp2 33*c2b51333SPeter Holmmount -t unionfs -o noatime $mp2 $mp1 34*c2b51333SPeter Holm 35*c2b51333SPeter Holmls -lr $mp1 $mp2 > /dev/null # triggers the panic 36*c2b51333SPeter Holm 37*c2b51333SPeter Holmumount $mp2 # The unionfs mount 38*c2b51333SPeter Holmumount $mp2 39*c2b51333SPeter Holmumount $mp1 40*c2b51333SPeter Holm 41*c2b51333SPeter Holmmdconfig -d -u $md1 42*c2b51333SPeter Holmmdconfig -d -u $md2 43*c2b51333SPeter Holmrm -f /tmp/$prog 44*c2b51333SPeter Holmexit 0 45