Nullfs - Panic when umounting and lower fs has been removed

Peter Holm peter at holm.cc
Mon May 20 08:54:39 UTC 2013


On Mon, May 20, 2013 at 10:34:26AM +0300, Konstantin Belousov wrote:
> On Sun, May 19, 2013 at 08:41:03PM +0000, Antoine Brodin wrote:
> > Hi there,
> > 
> > I encountered a panic on head today with nullfs using poudriere.
> > 
> > It is quite easy to reproduce,  the script is probably doing something
> > wrong but panicking is not nice
> > 
> > %%%
> > mkdir /tmp/.new_packages /mnt/new_packages
> > mount -t nullfs /tmp/.new_packages /mnt/new_packages
> > dd if=/dev/zero of=/mnt/new_packages/bar count=20000
> > mv /tmp/.new_packages/bar /tmp/
> > rm -rf /tmp/.new_packages
> > umount -f /mnt/new_packages
> > %%%
> > 
> > The panic:
> > 
> > userret: returning with the following locks held:
> > exclusive lockmgr ufs (ufs) r = 0 (0xfffffe0010a77548) locked @
> > /usr/src/sys/modules/nullfs/../../fs/nullfs/null_vnops.c:615
> > panic: witness_warn
> > cpuid = 0
> > KDB: enter: panic
> 
> This is strange, do you have witness enabled, but invariants not ?
> 
> Please try the following change.
> 
> diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c
> index ad02236..bece8c8 100644
> --- a/sys/fs/nullfs/null_vfsops.c

I can confirm the panic
http://people.freebsd.org/~pho/stress/log/kostik567.txt
and that the patch fixes that problem.

- Peter


More information about the freebsd-fs mailing list