From owner-freebsd-fs@FreeBSD.ORG Fri Dec 3 20:11:22 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0881716A4CE for ; Fri, 3 Dec 2004 20:11:22 +0000 (GMT) Received: from mailfe05.swip.net (mailfe05.swip.net [212.247.154.129]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0405D43D2D for ; Fri, 3 Dec 2004 20:11:21 +0000 (GMT) (envelope-from thn@saeab.se) X-T2-Posting-ID: v8Qc5gTTFq+hMtTEBMvVyQ== Received: from [213.100.91.82] (HELO scatcat.thn.saeab.se) by mailfe05.swip.net (CommuniGate Pro SMTP 4.2.6) with ESMTP id 38840953; Fri, 03 Dec 2004 21:11:19 +0100 Received: from saeab.se (home [10.1.0.1])iB3KBJuA008450; Fri, 3 Dec 2004 21:11:19 +0100 (CET) (envelope-from thn@saeab.se) Message-ID: <41B0C899.C005AE1E@saeab.se> Date: Fri, 03 Dec 2004 21:12:09 +0100 From: Thomas Nystrom Organization: Sv. Aktuell Elektronik AB X-Mailer: Mozilla 4.78 [en] (Win98; U) X-Accept-Language: sv,en MIME-Version: 1.0 To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: Dead vnode locking against itself X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2004 20:11:22 -0000 I'm trying to get ARLA to 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=0x296
) at /usr/src/sys/kern/kern_shutdown.c:537 #11 0xc0483de3 in chkvnlock (vp=0xc239d420) at /usr/src/sys/fs/deadfs/dead_vnops.c:248 #12 0xc0483d0a in dead_lock (ap=0xdb344914) at /usr/src/sys/fs/deadfs/dead_vnops.c:210 #13 0xc0515f8f in vclean (vp=0xc239d420, flags=8, td=0xc1c3d640) at vnode_if.h:1013 #14 0xc0516525 in vgonel (vp=0xc239d420, td=0xc1c3d640) at /usr/src/sys/kern/vfs_subr.c:2701 #15 0xc0513051 in vtryrecycle (vp=0xc239d420) at /usr/src/sys/kern/vfs_subr.c:720 #16 0xc051327a in getnewvnode (tag=0xc0645372 "ufs", mp=0xc1918000, vops=0x0, vpp=0x0) at /usr/src/sys/kern/vfs_subr.c:783 ---Type to continue, or q to quit--- #17 0xc05bac67 in ffs_vget (mp=0xc1918000, ino=427054, flags=2, vpp=0xdb344a84) at /usr/src/sys/ufs/ffs/ffs_vfsops.c:1230 #18 0xc05c1c64 in ufs_lookup (ap=0xdb344b40) at /usr/src/sys/ufs/ufs/ufs_lookup.c:599 #19 0xc05c7eaf in ufs_vnoperate (ap=0x0) at /usr/src/sys/ufs/ufs/ufs_vnops.c:2816 #20 0xc050b5d6 in vfs_cache_lookup (ap=0x0) at vnode_if.h:82 #21 0xc05c7eaf in ufs_vnoperate (ap=0x0) at /usr/src/sys/ufs/ufs/ufs_vnops.c:2816 #22 0xc050fcf3 in lookup (ndp=0xdb344c30) at vnode_if.h:52 #23 0xc050f778 in namei (ndp=0xdb344c30) at /usr/src/sys/kern/vfs_lookup.c:181 #24 0xc051a9f6 in lstat (td=0xc1c3d640, uap=0xdb344d14) at /usr/src/sys/kern/vfs_syscalls.c:2069 #25 0xc060e093 in syscall (frame= {tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi = 134609408, tf_esi = 134609480, tf_ebp = -1077941208, tf_isp = -617329292, tf_ebx = 672396780, tf_edx = 134561792, tf_ecx = 0, tf _eax = 190, tf_trapno = 12, tf_err = 2, tf_eip = 671905847, tf_cs = 31, tf_eflags = 658, t f_esp = -1077941364, tf_ss = 47}) at /usr/src/sys/i386/i386/trap.c:1001 #26 0xc06015ff in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception.s: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 -- --------------------------------------------------------------- Svensk Aktuell Elektronik AB Thomas Nyström Box 10 Phone: +46 8 35 92 85 S-191 21 Sollentuna Fax: +46 8 35 92 86 Sweden Email: thn@saeab.se ---------------------------------------------------------------