Re: [RFC] symlink caching and network filesystems

Erez Zadok (ezk@cs.columbia.edu)
Mon, 7 Jun 1999 13:48:53 -0400 (EDT)


In message <Pine.GSO.4.10.9906071155480.20892-100000@weyl.math.psu.edu>, Alexander Viro writes:
>
>
> On Mon, 7 Jun 1999, David S. Miller wrote:
>
> > Date: Mon, 7 Jun 1999 02:33:35 -0400 (EDT)
> > From: Alexander Viro <viro@math.psu.edu>
> >
> > 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.)
> >
> > Wait a minute. Are you talking about the userland server + normal
> > NFS client combination? <scratching head> Hrrrmm... But READLINK in
> > NFSv2 (and IIRC in v3 too) doesn't pass credentials, right? Could
> > you elaborate on that?
> >
> > This is a non-issue. Alexander, if I understand your proposal
> > correctly, the hlfsd issue is solved by using an attribute timeout of
> > zero. NFS must revalidate the inode on every access, so the symlink
> > cache validity is a by-product of inode revalidation. See?
>
> Yes, that will work, but I'm still curious what did Erez do ;-) Anyway, I
> think that I did the Rigth Thing(tm) with name handling and it solved the
> problem in a different way. Basically it's a new structure, holding a

My apologies for the brief message. I'm soon leaving town for a week.

Hlfsd is part of am-utils (aka Amd). It makes the value of the symlink
different based on the euid that it gets off of RPC info (via AUTH_UNIX).
You can check the sources to it if you're interested. Get the latest
am-utils in http://www.cs.columbia.edu/~ezk/am-utils/. You can find my
LISA-7 paper on hlfsd in http://www.cs.columbia.edu/~ezk/research/.

Dave is right that Linux does it right. As long as there's a way to ensure
that access to nfs-based symlinks can pass to the server on each user
access, I'm fine. Most OSs don't have NFS symlink caches, and thus a simple
turning off of the attr cache works ok; that usually happens with a mount
flag (noac) or by explicitly setting the ac{dir,reg}{min,max} to 0. But
I've seen OSs, where 0 doesn't work, and you have to set it to a small
positive number. I've seen OSs (Solaris and Irix) where there's an explicit
nfs symlink cache, and normal attr cache mechanisms do not turn that off.
Luckily Solaris and Irix have a special mount flag to turn off nfs symlink
caching.

Also someone reported to me that at some point freebsd added symlink caches
but that their attribute turning off code got broken. I've not verified
that with recent freebsd versions.

Erez.

-
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/