Subject: Re: Making file handles useful outside of NFS
To: Bill Studenmund <wrstuden@nas.nasa.gov>
From: Ignatios Souvatzis <is@jocelyn.rhein.de>
List: tech-kern
Date: 02/26/1999 20:34:07
On Fri, Feb 26, 1999 at 10:52:08AM -0800, Bill Studenmund wrote:
> On Fri, 26 Feb 1999, Wolfgang Solfrank wrote:
> 
> > > Looks okay to me. While you're at it, maybe you can split off exporting
> > > filesystems from the mount() system call, i.e. introduce an exportfs()
> > > system call (as SunOS had) :-) Overloading the mount call with this is
> > > kind of ugly.
> 
> To be honest, I'm not sure what we need here. I'm only now (since reading
> this message :-) starting to look at it. What else would we need other
> than:
> 
> 1) an extra vfs entry which takes a mount point and a struct export_args
> 	*, and flags, and does the export update (basically calls
> 	vfs_export)
> 
> 2) a new syscall which takes a path, flags,  and a struct export_args *,
> 	looks up the path, does mount update's securelevel >=2 check,
> 	makes sure you're root, and calls the new vfs call from the vfs
> 	args of	the mount point of the vnode.
> 
> ?? I'll need help to do this. :-)

Uhm, I'm no expert, but I'd start checking for root. ;-)
> 
> > And maybe this could solve the problem of clients getting "permission
> > denied"
> > while mountd re-read its exports file ? (see kern/5844 for details).
> 
> I think what we need to do here is either put the nfs server to sleep
> while updating, or actually make the call be able to cancel exports. So
> that mountd would figure out what had changed since last read, and
> add/subtract exports (I think now it just clears all and re-adds).
> 
> The latter's beyond what I can do at the moment.

The former doesnt look too bad... presumably, you'll just need a tiny amount
of time to do the updating?

OTOH, it smells a small bit like the One Big Lock Method Of Pretending You Do
SMP Support.

I don't know the access rights data structure, (I think Stevens/Wright mention
it uses an instance of the routing table), but if we can just have TWO versions
of it: the active and the one you manipulate, you can create the latter, then
do an sort-of-atomic switch (well, locking the server just for a small amount
of time).

Regards,
	-is