From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 21 08:08:20 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A45316A41F for ; Wed, 21 Sep 2005 08:08:20 +0000 (GMT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from comsys.ntu-kpi.kiev.ua (comsys.ntu-kpi.kiev.ua [195.245.194.142]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8DD5143D45 for ; Wed, 21 Sep 2005 08:08:16 +0000 (GMT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from pm514-9.comsys.ntu-kpi.kiev.ua (pm514-9.comsys.ntu-kpi.kiev.ua [10.18.54.109]) (authenticated bits=0) by comsys.ntu-kpi.kiev.ua (8.12.10/8.12.10) with ESMTP id j8L8Gghw049039 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Sep 2005 11:16:43 +0300 (EEST) Received: by pm514-9.comsys.ntu-kpi.kiev.ua (Postfix, from userid 1000) id 6C9E0114; Wed, 21 Sep 2005 11:05:33 +0300 (EEST) Date: Wed, 21 Sep 2005 11:05:33 +0300 From: Andrey Simonenko To: Sebastien Message-ID: <20050921080533.GA255@pm514-9.comsys.ntu-kpi.kiev.ua> References: <200509201949.53951.sebastien.bourdeauducq@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200509201949.53951.sebastien.bourdeauducq@gmail.com> User-Agent: Mutt/1.4.2.1i X-Spam-Status: No, score=-4.5 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.1 X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on comsys.ntu-kpi.kiev.ua X-Virus-Scanned: ClamAV 0.82/1049/Wed Aug 31 10:19:01 2005 on comsys.ntu-kpi.kiev.ua X-Virus-Status: Clean Cc: freebsd-hackers@freebsd.org Subject: Re: Filesystem access from a KLD causes "vrele: negative ref cnt" panic X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2005 08:08:20 -0000 On Tue, Sep 20, 2005 at 07:49:53PM +0200, Sebastien wrote: > > I have a random panic "vrele: negative ref cnt" when I shutdown the system. Am > I double-freeing something in my code ? The fact that the panic is caused > randomly suggests there is a synchronization problem - but the above code is > always running under the protection of the Giant mutex. [ please don't write such long lines ] Should not rootvnode get reference, when fd_rdir or fd_cdir begins to point to it? Try to VREF() it. Which vnode gets negative reference counter?