From owner-freebsd-stable@FreeBSD.ORG Wed May 8 17:59:04 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E88FFE05 for ; Wed, 8 May 2013 17:59:04 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) by mx1.freebsd.org (Postfix) with SMTP id A51FF22C for ; Wed, 8 May 2013 17:59:04 +0000 (UTC) Received: (qmail 62483 invoked from network); 8 May 2013 17:58:57 -0000 Received: from 87.58.146.155 (HELO x2.osted.lan) (87.58.146.155) by relay01.pair.com with SMTP; 8 May 2013 17:58:57 -0000 X-pair-Authenticated: 87.58.146.155 Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.5/8.14.5) with ESMTP id r48Hwuk9032414; Wed, 8 May 2013 19:58:56 +0200 (CEST) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.5/8.14.5/Submit) id r48Hwuc2032413; Wed, 8 May 2013 19:58:56 +0200 (CEST) (envelope-from pho) Date: Wed, 8 May 2013 19:58:56 +0200 From: Peter Holm To: Konstantin Belousov Subject: Re: Nullfs leaks i-nodes Message-ID: <20130508175856.GA32341@x2.osted.lan> References: <20130508091317.GJ3047@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130508091317.GJ3047@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 17:59:05 -0000 On Wed, May 08, 2013 at 12:13:17PM +0300, Konstantin Belousov wrote: > On Tue, May 07, 2013 at 08:30:06AM +0200, G??ran L??wkrantz wrote: > > I created a PR, kern/178238, on this but would like to know if anyone has > > any ideas or patches? > > > > Have updated the system where I see this to FreeBSD 9.1-STABLE #0 r250229 > > and still have the problem. > > The patch below should fix the issue for you, at least it did so in my > limited testing. > > What is does: > 1. When inactivating a nullfs vnode, check if the lower vnode is > unlinked, and reclaim upper vnode if so. [This fixes your case]. > > 2. Besides a callback to the upper filesystems for the lower vnode > reclaimation, it also calls the upper fs for lower vnode unlink. > This allows nullfs to purge cached vnodes for the unlinked lower. > [This fixes an opposite case, when the vnode is removed from the > lower mount, but upper aliases prevent the vnode from being > recycled]. > > 3. Fix a wart which existed from the introduction of the nullfs caching, > do not unlock lower vnode in the nullfs_reclaim_lowervp(). It should > be completely innocent, but now it is also formally safe. > > 4. Fix vnode reference leak in nullfs_reclaim_lowervp(). > > Please note that the patch is basically not tested, I only verified your > scenario and a mirror of it as described in item 2. > > diff --git a/sys/fs/nullfs/null.h b/sys/fs/nullfs/null.h > index 4f37020..a624be6 100644 I got this page fault after interrupting a nullfs test that had been running for three hours: http://people.freebsd.org/~pho/stress/log/kostik562.txt - Peter