From owner-freebsd-current@FreeBSD.ORG Tue Feb 5 21:40:41 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C34E16A418 for ; Tue, 5 Feb 2008 21:40:41 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185]) by mx1.freebsd.org (Postfix) with ESMTP id 9B31513C442 for ; Tue, 5 Feb 2008 21:40:40 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so646917nfb.33 for ; Tue, 05 Feb 2008 13:40:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=uM9Lhkej+QzprdP4lzpcil9ghtAoG5W6lpzK0ywASV4=; b=Ak3Cvp1GltdQtmq3ulpJxxXQ7HfquOdP+GQ7sNxgT5LTi4fi7Wkh78wAi9j3HvUcDr+0+olPVEL5fCpQU7IY0AOmTvcEgBUNLCF7CHhy6yBgVWzSylW039b59kt9pO6szF72qVHwi9gjPNGYaHHniOStD8WWXH+yjzYzzPjyI5k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=BmZZHY4wQZ2Pkz7QzapWcVeDPLcUVZgcCEQfoD9pyen4CDAS5qM4jlVohWD2mBpRRWLsr9kk1JnrwDGdzPc4wrnMbgxWrejv04BlZD6Gl1zTTFlKG7lXTtfuqO9+CIEogmP1lQvV30I5gVIcZEwwDYi1XgeN47Q0D7lk2wJXWj4= Received: by 10.86.84.5 with SMTP id h5mr8283298fgb.53.1202247639331; Tue, 05 Feb 2008 13:40:39 -0800 (PST) Received: by 10.86.28.19 with HTTP; Tue, 5 Feb 2008 13:40:39 -0800 (PST) Message-ID: <3bbf2fe10802051340x27991e22jcf37274456165792@mail.gmail.com> Date: Tue, 5 Feb 2008 22:40:39 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Scot Hetzel" In-Reply-To: <790a9fff0801161624g459857b8y6217e579337f2f0e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <790a9fff0801150552l542a4238ofc12efe5fdb45fc2@mail.gmail.com> <20080115143924.GB57756@deviant.kiev.zoral.com.ua> <790a9fff0801152301l5d50461aw3a253608506368e2@mail.gmail.com> <790a9fff0801161624g459857b8y6217e579337f2f0e@mail.gmail.com> X-Google-Sender-Auth: 5c66dd900f5bee7e Cc: Kostik Belousov , freebsd-current@freebsd.org Subject: Re: panic: System call lstat returning with 1 locks held X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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, 05 Feb 2008 21:40:41 -0000 2008/1/17, Scot Hetzel : > On 1/16/08, Scot Hetzel wrote: > > On 1/15/08, Kostik Belousov wrote: > > > On Tue, Jan 15, 2008 at 07:52:12AM -0600, Scot Hetzel wrote: > > > > When I boot a Jan 13th or Jan 15th kernel, and then run > > > > /usr/local/etc/cvsup/update.sh to update the local CVS repository, I > > > > get the following panic: > > > > > > > > panic: System call lstat returning with 1 locks held > > > > cpuid = 0 > > > > KDB: enter: panic > > > > [thread ; pid 1240 tid 10031] > > > > stopped at kdb_enter+0x3d: movq $0,0x41b048(%rip) > > > > db> show alllocks > > > > db> show locks > > > > db> bt > > > > tracing pid 1240 tid 10031 td 0xffffff001c1ad360 > > > > kdb_enter() at kdb_enter+0x3d > > > > panic() at panic+0x176 > > > > syscalls() at syscalls+0x66d > > > > Xfast_syscalls() at Xfast_syscalls+0xab > > > > --- syscall (0, FreeBSD ELF64, nosys), rip = 0x8009e87ec, rsp= > > > > 0x72ec50, rbp = 0x72ed28 --- > > > > > > > I think this could be related to the recent vn_lock()/VOP_LOCK() KPI changes. > > > Please, add DEBUG_VFS_LOCKS to the kernel config, and do the > > > show lockedvnods > > > from the ddb prompt when the panic occurs. The witness does not track > > > the lockmgr locks. > > > > > I added DEBUG_VFS_LOCKS to the kernel config file, rebuilt and > > installed the kernel. After rebooting the system, I started the cvsup > > update for my local mirror, when the panic occured I received a > > similar panic to the one above. When I used 'show lockedvnods' the > > only thing that was displayed was 'Locked vnodes' and that was it. > > > > I'm going to try a binary search to see if I can narrow the problem down. > > > > Scot > > > > I found the point where the problem occurs. If I update /usr/src/sys > to Jan 08 23:45 UTC 2008, then I don't get the lstat panic. But when > I update to Jan 08 23:49 UTC 2008, the panic returns. > > These are the files that change between these times: > > dev/usb/ehci.c: > $FreeBSD: src/sys/dev/usb/ehci.c,v 1.57 2008/01/08 23:48:30 attilio Exp $ > > dev/usb/if_udav.c: > $FreeBSD: src/sys/dev/usb/if_udav.c,v 1.34 2008/01/08 23:48:30 > attilio Exp $ > > fs/hpfs/hpfs_subr.h: > $FreeBSD: src/sys/fs/hpfs/hpfs_subr.h,v 1.4 2008/01/08 23:48:31 > attilio Exp $ > > fs/ntfs/ntfs_subr.c: > $FreeBSD: src/sys/fs/ntfs/ntfs_subr.c,v 1.43 2008/01/08 23:48:31 > attilio Exp $ > > kern/kern_lock.c: > $FreeBSD: src/sys/kern/kern_lock.c,v 1.117 2008/01/08 23:48:31 > attilio Exp $ > > sys/buf.h: > $FreeBSD: src/sys/sys/buf.h,v 1.197 2008/01/08 23:48:31 attilio Exp $ > > sys/lockmgr.h: > $FreeBSD: src/sys/sys/lockmgr.h,v 1.56 2008/01/08 23:48:31 attilio Exp $ At least now I know why the problem has became visible just after these commits. This is because before ntfs lockmgr were just working with the kernel as owner; consequently td_locks could not be bumped and the problem was hiding. I think, also, the problem is not linked to vnodes, so having vnodes debugging should not produce any difference. NTFS uses a lot of lockmgr for tracking its internal stuffs. More analysis to come. Attilio -- Peace can only be achieved by understanding - A. Einstein