From owner-freebsd-current@FreeBSD.ORG Sat Feb 9 23:11:51 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 2681116A50C for ; Sat, 9 Feb 2008 23:11:51 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by mx1.freebsd.org (Postfix) with ESMTP id E44A813C478 for ; Sat, 9 Feb 2008 23:11:48 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so3498208fgg.35 for ; Sat, 09 Feb 2008 15:11:47 -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=68CCEfZiOKGKAEMClAdnUv1hodZZhLRYoapwo9PhneM=; b=qxNymWPj47zoTQnmNyuTM7say4U905hHYoPTmE+9Rb0DYT/UO38QiJx6crVHXPkNA5/d+us/0MQ3i3llISmrSKLARuHvRoSKWZj3OqN1vTSkQX489MUX/8rNi2LrO+0FMps8T7L0PT8KfJ/W1QOuKQL0G8fRKO2X/JPT9FW8d8k= 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=QNoTw0rEnQ2HjH1pfyXKNcNNHLZxCJbKfap7qQebbnCYWWciN1IQFeMlIne1HVtX9ZededxQYVnATmzlDsY30N4n5WtOJY+DR90fURk1m6wI5wy5wyVa1t/2Yhn7REwtsnqW97dKJzsJqM4EZ+5lfLUgSXEMxP8kpDJtjTtPjjA= Received: by 10.86.53.8 with SMTP id b8mr13323795fga.64.1202598707310; Sat, 09 Feb 2008 15:11:47 -0800 (PST) Received: by 10.86.28.19 with HTTP; Sat, 9 Feb 2008 15:11:47 -0800 (PST) Message-ID: <3bbf2fe10802091511p201ee404g76a835f49d9291ac@mail.gmail.com> Date: Sun, 10 Feb 2008 00:11:47 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Yar Tikhiy" In-Reply-To: <20080209203317.GB62234@comp.chem.msu.su> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <790a9fff0801312241s346068b6s40fcae71ebbf546@mail.gmail.com> <3bbf2fe10802011041t28e419c9n5f0f6f34d6450184@mail.gmail.com> <20080205162217.GA56373@comp.chem.msu.su> <3bbf2fe10802051156p1cc6ea67t7938a60e306323ce@mail.gmail.com> <20080206112930.GD7592@comp.chem.msu.su> <3bbf2fe10802060549u66b1067cy4bb9d4232ccef05d@mail.gmail.com> <20080206144802.GH7592@comp.chem.msu.su> <3bbf2fe10802060652y3782d023k9c5299168a81093d@mail.gmail.com> <3bbf2fe10802060657h1dbc93e2lf3fd1b0c6843f674@mail.gmail.com> <20080209203317.GB62234@comp.chem.msu.su> X-Google-Sender-Auth: 88db5c7db2d3e34b Cc: yar@freebsd.org, Scot Hetzel , Doug Barton , freebsd-fs@freebsd.org, freebsd-current@freebsd.org, Kostik Belousov 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: Sat, 09 Feb 2008 23:11:51 -0000 2008/2/9, Yar Tikhiy : > On Wed, Feb 06, 2008 at 03:57:58PM +0100, Attilio Rao wrote: > > 2008/2/6, Attilio Rao : > > > 2008/2/6, Yar Tikhiy : > > > > > > > On Wed, Feb 06, 2008 at 02:49:49PM +0100, Attilio Rao wrote: > > > > [...] > > > > > > > > > Want to see if this bt has been helpful? :) > > > > > Can you try the attached patch and see if kernel rings a bell?: > > > > > http://www.freebsd.org/~attilio/ntfs_debug.diff > > > > > > > > > > > > The kernel just panics. :-) > > > > > > > > > This is the new I wanted to know! :) > > > With better checks in lockmgr code, we would have caught more > > > informations about it. > > > > > > Can you please now add DDB support and once it breaks in DDB do a > > > 'show alllocks' and maybe other small investigations? > > > This should shade a light for us. > > > > Could you please enable NTFS_DEBUG too and maybe see, when the kernel > > panics, what is the value of i_usecount for the specified ip? > > I want to exclude refcount leaking. > > > i_usecount is just zero for the faulty ip: > With the determinant yar's help, I think I found how the lock leak happens. Basically, in ntfs_ntput() the inode refcount (ip->i_usecount) is decreased and after checked. When check its i_usecount == 0, it means that initially i_usecount == 1 which also means the lockmgr() was held. For the i_usecount == 0 logic, however, no lockmgr release operation is previewed. This patch should fix the NTFS problems even with stricter assertions I plan to commit rather soon: http://www.freebsd.org/~attilio/ntfs.diff This patch was initially provided by yar as a workaround, but it moved me in analyzing refcount handling and finding this bug. Please test and report if it solves problems for you. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein