Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 Dec 2004 10:53:10 +0100
From:      Thomas Nystrom <thn@saeab.se>
To:        stable@freebsd.org
Subject:   Dead vnode locking against itself
Message-ID:  <41B03786.8060106@saeab.se>

next in thread | raw e-mail | index | archive | help
I'm trying to get ARLA work stable on FreeBSD (5.3-RELEASE) but have
found that it sometimes hangs: A process gets stuck in 'ckvnlk' state.

I have found someting strange (probably a bug) but I need a second
opinion.

I patched fs/deadfs/dead_vnops so it does a panic when it tries to go
into ckvnlk state and found that it seems to lock against itself.

Part of the backtrace:

#10 0xc04c6f8f in panic (fmt=3D0x296 <Address 0x296 out of bounds>)
     at /usr/src/sys/kern/kern_shutdown.c:537
#11 0xc0483de3 in chkvnlock (vp=3D0xc239d420) at /usr/src/sys/fs/deadfs/d=
ead_vnops.c:248
#12 0xc0483d0a in dead_lock (ap=3D0xdb344914) at /usr/src/sys/fs/deadfs/d=
ead_vnops.c:210
#13 0xc0515f8f in vclean (vp=3D0xc239d420, flags=3D8, td=3D0xc1c3d640) at=
 vnode_if.h:1013
#14 0xc0516525 in vgonel (vp=3D0xc239d420, td=3D0xc1c3d640)
     at /usr/src/sys/kern/vfs_subr.c:2701
#15 0xc0513051 in vtryrecycle (vp=3D0xc239d420) at /usr/src/sys/kern/vfs_=
subr.c:720
#16 0xc051327a in getnewvnode (tag=3D0xc0645372 "ufs", mp=3D0xc1918000, v=
ops=3D0x0, vpp=3D0x0)
     at /usr/src/sys/kern/vfs_subr.c:783
---Type <return> to continue, or q <return> to quit---
#17 0xc05bac67 in ffs_vget (mp=3D0xc1918000, ino=3D427054, flags=3D2, vpp=
=3D0xdb344a84)
     at /usr/src/sys/ufs/ffs/ffs_vfsops.c:1230
#18 0xc05c1c64 in ufs_lookup (ap=3D0xdb344b40) at /usr/src/sys/ufs/ufs/uf=
s_lookup.c:599
#19 0xc05c7eaf in ufs_vnoperate (ap=3D0x0) at /usr/src/sys/ufs/ufs/ufs_vn=
ops.c:2816
#20 0xc050b5d6 in vfs_cache_lookup (ap=3D0x0) at vnode_if.h:82
#21 0xc05c7eaf in ufs_vnoperate (ap=3D0x0) at /usr/src/sys/ufs/ufs/ufs_vn=
ops.c:2816
#22 0xc050fcf3 in lookup (ndp=3D0xdb344c30) at vnode_if.h:52
#23 0xc050f778 in namei (ndp=3D0xdb344c30) at /usr/src/sys/kern/vfs_looku=
p.c:181
#24 0xc051a9f6 in lstat (td=3D0xc1c3d640, uap=3D0xdb344d14)
     at /usr/src/sys/kern/vfs_syscalls.c:2069
#25 0xc060e093 in syscall (frame=3D
       {tf_fs =3D 47, tf_es =3D 47, tf_ds =3D 47, tf_edi =3D 134609408, t=
f_esi =3D 134609480, tf_ebp
=3D -1077941208, tf_isp =3D -617329292, tf_ebx =3D 672396780, tf_edx =3D =
134561792, tf_ecx =3D 0, tf
_eax =3D 190, tf_trapno =3D 12, tf_err =3D 2, tf_eip =3D 671905847, tf_cs=
 =3D 31, tf_eflags =3D 658, t
f_esp =3D -1077941364, tf_ss =3D 47}) at /usr/src/sys/i386/i386/trap.c:10=
01
#26 0xc06015ff in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception=
=2Es:201

If I look at the source I can see that in sys/kern/vfs_subr.c:2696
(in vgonel) the vnode is locked by VI_XLOCK. Later on (via vclean)
dead_lock is called and founds that the vnode is locked. It then
waits for it to be unlocked and the results is a hanged process.

What have I missed or have I found a bug?

/thn

--=20
---------------------------------------------------------------
Svensk Aktuell Elektronik AB                     Thomas Nystr=F6m
Box 10                                    Phone: +46 8 35 92 85
S-191 21  Sollentuna                        Fax: +46 8 35 92 86
Sweden                                      Email: thn@saeab.se
---------------------------------------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41B03786.8060106>