Well, the recent discussion gave me an idea for how one may be able to handle ghosting (and possibly direct mounts, although I'd still prefer to do it via dentry traps) cleanly: by putting a read_link method on the autofs leaf directories and push a lot of the lookup there. That means lstat() will return the "ghost", as if it had been a symlink, and thus GUI tools and ls -l will be happy, but unlike a real symlink, tools like ls -l will not then try to look at the "real" directory behind it.

Thus all is good.

I was a bit uncertain if this could actually be done without causing infinite recursion, but some initial experiments seems to make it work.

With this, I might be able to do without dentry traps for autofs 5, although I would still prefer to have them, for the sheer reason that it might otherwise require a plain preposterous number of superblocks (mounts.) The reason for this is that any time an automounted filesystem is on top of another mounted filesystem, as in the case of the following key:

foo / foosrv:/export/root /bar foosrv:/export/bar

... it is functionally equivalent to foo/bar being a direct mount in order for everything to be done cleanly. Similarly, "scaffolding" directories could be done using a ramfs, but now we're up to a total number of two superblocks per submount point (one for the "direct mount", one for the mount itself), plus one for the ramfs. The ramfs could be eliminated by making the autofs more ramfs-like, which is pretty much a no-brainer anyway... the current autofs replicates way more code than it needs to.

This is way interesting...

-hpa

_______________________________________________
autofs mailing list
[EMAIL PROTECTED]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to