Re: [RFC] symlink caching and network filesystems

Alexander Viro (viro@math.psu.edu)
Mon, 7 Jun 1999 10:50:06 -0400 (EDT)


On Mon, 7 Jun 1999, Erez Zadok wrote:

> I'm not sure this is relevant, but please ensure that there's a way for
> mount() to turn off such symlink caching. It's useful for my user-level
> hlfsd to turn off symlink caching, esp. over nfs. (Hlfsd creates a symlink
> that points to different places depending on the euid accessing the symlink;
> it's used to redirect /var/mail to users' home dirs.)

OK, looks like I did it for everything except UMSDOS and NFS (sorry).
There are 3 caching startegies:
a) VOLATILE (set S_VOLATILE_LINK in inode->i_flags). No caching
for that inode.
b) LCACHE (S_LCACHE_LINK). Cached upon the first sys_readlink()/
do_follow_link(), released when inode is ditched by icache.
c) default: cached upon the sys_readlink()/do_follow_link(),
released when operation is completed. If something else calls any of those
operations during this period it will get the cached value (and the
lifetime will be prolonged, indeed).
I didn't mess with mount options yet, but it's fairly trivial -
all we need is to set those 2 bits in read_inode() for symlinks. Is this
OK for you? All of those versions take lookup_dentry() out of the fs - all
the difference is in caching policies.

I see how to do it with NFS, but it's a kludge - I need fhandle by
inode and the best thing I see right now is NFS_FH() applied to any alias
of inode ;-< Bletch... I suspect that there is a better way to do that,
but I'm pretty slow right now - 20 hours of tube time... Anyway, kludge or
not, there is a way to do that.

Situation with UMSDOS is much nastier, mostly due to possible
interactions with dmsdos and friends. Oh, well...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/