From owner-freebsd-stable@FreeBSD.ORG Fri Dec 3 09:53:15 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 93CB816A4CE for ; Fri, 3 Dec 2004 09:53:15 +0000 (GMT) Received: from saeab.se (ture.saeab.se [213.80.3.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17EEB43D41 for ; Fri, 3 Dec 2004 09:53:14 +0000 (GMT) (envelope-from thn@saeab.se) Received: from [10.0.1.32] (omar.int.saeab.se [10.0.1.32]) by saeab.se (8.13.1/8.13.1) with ESMTP id iB39rA99087386; Fri, 3 Dec 2004 10:53:10 +0100 (CET) (envelope-from thn@saeab.se) Message-ID: <41B03786.8060106@saeab.se> Date: Fri, 03 Dec 2004 10:53:10 +0100 From: Thomas Nystrom Organization: Sv. Aktuell Elektronik AB User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: sv,en MIME-Version: 1.0 To: stable@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-6.0 required=5.0 tests=USER_IN_WHITELIST_TO autolearn=no version=2.64 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on ture.saeab.se X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.6 (saeab.se [213.80.3.133]); Fri, 03 Dec 2004 10:53:12 +0100 (CET) Subject: Dead vnode locking against itself X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2004 09:53:15 -0000 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
) 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 to continue, or q 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 ---------------------------------------------------------------