Subject: Re: CVS commit: syssrc/sys/miscfs/nullfs
To: enami tsugutomo <enami@sm.sony.co.jp>
From: Bill Studenmund <wrstuden@wasabisystems.com>
List: source-changes
Date: 03/14/2002 09:28:51
On 14 Mar 2002, enami tsugutomo wrote:

> Bill Studenmund <wrstuden@netbsd.org> writes:
>
> > I really don't see how we would keep the cache otherwise. What would we
> > (reliably) cache on otherwise? If we don't keep the reference, the vnode
> > can get recycled under us, and then all hell can break loose.
>
> Invalidate the cache entry when vnode is recyled?  Or, borrow v_id and
> kill entire hash when name cache does it?

Which vnode are we talking about? We key the hash table on the lower
vnode's address, so we need to either make sure that vnode doesn't go away
(which we do by keeping a reference now), or we know when it does.

We probably could do something with v_id, but I think it would just be
easier to hang onto the reference. We definitly want to hold the reference
while we are using the upper vnode. So either we hold it all the time, or
we grab it & release it & grab it & release it. The latter seems
computationally intensive, since (with VOP_UPCALL or whatever we end up
doing) we can know when we need to do something.

Thoughts?

Take care,

Bill