From owner-freebsd-current@FreeBSD.ORG Mon Nov 17 23:37:43 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 542E516A4D2 for ; Mon, 17 Nov 2003 23:37:43 -0800 (PST) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id B85ED43FDD for ; Mon, 17 Nov 2003 23:37:41 -0800 (PST) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.9p2/8.12.9) with ESMTP id hAI7bYeF089805 for ; Mon, 17 Nov 2003 23:37:38 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <200311180737.hAI7bYeF089805@gw.catspoiler.org> Date: Mon, 17 Nov 2003 23:37:34 -0800 (PST) From: Don Lewis To: current@FreeBSD.org MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Subject: vnode lock violation in today's -CURRENT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2003 07:37:43 -0000 I just ran into this while running portupgrade. VOP_GETATTR: 0xc741e000 is not locked but should be Debugger("Lock violation. ") Stopped at Debugger+0x55: xchgl %ebx,in_Debugger.0 db> tr Debugger(c08bf9aa,c9749c78,c741e000,c08bf9eb,e820c984) at Debugger+0x55 vfs_badlock(c08bf9eb,c9749c78,c741e000,c09590e0,c741e000) at vfs_badlock+0x45 assert_vop_locked(c741e000,c9749c78,e820c9dc,0,e820c9c0) at assert_vop_locked+0x62 getdents_common(c6ede500,e820cd10,1,e820cd40,c0848b70) at getdents_common+0xfa linux_getdents64(c6ede500,e820cd10,c08d6778,3ee,3) at linux_getdents64+0x20 syscall(2f,2f,2f,5,0) at syscall+0x2c0 Xint0x80_syscall() at Xint0x80_syscall+0x1d --- syscall (220, Linux ELF, linux_getdents64), eip = 0x805a028, esp = 0xbfbfdc5c, ebp = 0xbfbfdcb8 --- It looks to me like the call to vn_lock() in getdents_common() needs to be moved to before the call to VOP_GETATTR(). The malloc() call should probably be moved as well, which means that the intervening error handling needs to be tweaked.