Subject: Re: tmpfs: Reclaiming vnodes
To: None <>
From: Julio M. Merino Vidal <>
List: tech-kern
Date: 08/05/2005 14:13:21
Thanks to all!  I've finally got this specific thing working :-)

On 8/5/05, Jason Thorpe <> wrote:
> On Aug 3, 2005, at 1:06 PM, Julio M. Merino Vidal wrote:
> > Then, I have problems with the rmdir operation itself.  I first
> > detach a_vp from its tmpfs_node by setting v_data and
> > tn_node both to NULL.  Then I call vput over a_vp, as other
> > file-systems do.  After this, I free the associated tmpfs_node
> > given that no-one else is pointing to it.
> But you'll note that other file systems don't free their v_data.
> That's because there is only one way that the VFS layer asks the file
> system to tear down the relationship.  That's the VOP_RECLAIM()
> path.  That is the only place where you should be tearing your
> tmpfs_node down.
> > *But* a_vp is not really "released".  When I unmount the
> > file-system, the kernel calls the fsync and reclaim operations
> > over the value a_vp had (the vnode used during rmdir).  As
> > this vnode has v_data set to NULL, any attempt to access the
> > structure obviously fails and panics the system.
> Right.  So don't do that in your rmdir routine... wait for the VFS
> layer to reclaim the vnode, then you should be OK.
> -- thorpej

Julio M. Merino Vidal <>
The NetBSD Project -