[OpenAFS-devel] getcwd() on Linux 2.6.18+OpenAFS 1.4.2 bugs/errors.

Jim Rees rees@umich.edu
Fri, 9 Nov 2007 09:50:30 -0500


Sorry for the sloppy language.  I'll try to be more formal.

I think what you're asking for is the ability to have undirected cycles in
the namespace, while prohibiting traversals toward the root except by the
path that took you to a particular place.

I think this is going to be hard to do in afs.  It more properly belongs in
the vnode layer (or whatever passes for that in your OS of choice).  Afs
currently keeps a single parent pointer in the vcache.  You would instead
need a list of these, and information about which one to choose.  That
information has to be available to afs_lookup.

The problem is that afs_lookup has no way of knowing which one to choose.
All it has is a vnode pointer, which will be the same for each of the
possible parents.  It's also got creds and it knows what user process it's
running in, so I guess it could be done per-user or per-process if that's
good enough for you, although this would be tricky to get right.

Kolya's suggestion was to allocate different vnodes each time a mount point
is looked up from a new parent.  Presumably the vcache would have a list of
parent vcaches and corresponding vnodes.  That would violate one of the
fundamental assumptions of the vnode layer, that identical objects have the
same vnode.  But since we're only talking about directories, maybe it would
work.

I'd also be curious what would happen if the path you took to get to some
place went away.  I guess you would be orphaned.  Is that what you want?