Multiple ZFS pools = panic on shutdown?

Daniel Eriksson daniel_k_eriksson at telia.com
Fri Jan 18 03:09:20 PST 2008


I wrote:
> Has anyone heard of or experienced any panics ("vput: 
> negative ref cnt" or "vrele: negative ref cnt") when
> shutting down a box with more than one zpool?

After doing some testing I've come up with the following simple steps to
recreate the panic:

1. Create the pools and then export them
2. Reboot the computer
3. Import the pools, touch some files on them and then export them again
4. Reboot again -> BOOM!


Create the pools
----------------
dd if=/dev/zero of=/usr/_disk1 bs=1m count=128
dd if=/dev/zero of=/usr/_disk2 bs=1m count=128
dd if=/dev/zero of=/usr/_disk3 bs=1m count=128
dd if=/dev/zero of=/usr/_disk4 bs=1m count=128
mdconfig -f /usr/_disk1 -u 1
mdconfig -f /usr/_disk2 -u 2
mdconfig -f /usr/_disk3 -u 3
mdconfig -f /usr/_disk4 -u 4
/etc/rc.d/zfs forcestart
zpool create tank1 mirror md1 md2
zpool create tank2 mirror md3 md4
touch /tank1/testfile
touch /tank2/testfile
zpool export tank1
zpool export tank2
/etc/rc.d/zfs forcestop
mdconfig -d -u 1
mdconfig -d -u 2
mdconfig -d -u 3
mdconfig -d -u 4

Import the pools
----------------
mdconfig -f /usr/_disk1 -u 1
mdconfig -f /usr/_disk2 -u 2
mdconfig -f /usr/_disk3 -u 3
mdconfig -f /usr/_disk4 -u 4
/etc/rc.d/zfs forcestart
zpool import tank1
zpool import tank2
touch /tank1/testfile
touch /tank2/testfile
zpool export tank1
zpool export tank2
/etc/rc.d/zfs forcestop
mdconfig -d -u 1
mdconfig -d -u 2
mdconfig -d -u 3
mdconfig -d -u 4


/Daniel Eriksson


More information about the freebsd-stable mailing list