Subject: Re: /proc/${pid}/exe not working
To: Bill Studenmund <>
From: Antti Kantee <>
List: current-users
Date: 02/26/2007 22:15:50
On Mon Feb 26 2007 at 11:56:04 -0800, Bill Studenmund wrote:
> > That's because cwd can do real getcwd if the entry is not found in the
> > cache - directories always have a unique parent.  Other types of file
> > system nodes, however, lack this luxury (think hardlinks).
> > 
> > As a hack to fix a hack, maybe we can add layerfs support the name cache?
> > What do people think?
> How would layerfs help? getcwd falls back on looking up ".." in a dir, and 
> that will fall through to the lower fs, which will find it in the cache.

No, the problem is that nullfs doesn't enter anything into the name
cache and we can't do getcwd for regular files.  So my thinking was
telling cache_revlookup that if it doesn't succeed for layered vnodes,
it could consult lower layer nodes also for revlookup information.
Of course it would get information from the wrong layer back unless
it would do a linear scan of the upper layer to find the correct vnode
(or do we have a nicer way of doing lower->upper lookup?).

> Being able to enumerate parents of a hard link is what we'd need, and is 
> something that would need coordination with all other ffs systems (so it 
> would keep up to date).

That's a whole other beast.  But that's still on the lower layer, not
the upper null layer we're worried about here.

Antti Kantee <>                     Of course he runs NetBSD                
    "la qualité la plus indispensable du cuisinier est l'exactitude"