Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 May 2013 19:58:56 +0200
From:      Peter Holm <peter@holm.cc>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Nullfs leaks i-nodes
Message-ID:  <20130508175856.GA32341@x2.osted.lan>
In-Reply-To: <20130508091317.GJ3047@kib.kiev.ua>
References:  <B799E3B928B18B9E6C68F912@[172.16.2.62]> <20130508091317.GJ3047@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130508175856.GA32341>