Re: WIP Patch: Cleanup of knfsd export handling.

H.J. Lu (hjl@lucon.org)
Thu, 23 Sep 1999 17:04:38 -0700 (PDT)


>
> The current export handling by rpc.kmountd and friends is complex, and relies
> on various state files (/var/lib/{e,x,rm}tab) which tend to get out of sync
> with the real world, causing clients which ought to be authenticated to
> complain of stale file handles.
>
> The fundamental reason for this is because the kernel can only handle FQDN
> export entries; not network or group entries. So mountd has to add and remove
> individual host entries when the client in question makes a mount/unmount
> request respectively.
>
> The problem comes when the server is restarted (or crashes). If the server's
> list of active clients is incorrect, for whatever reason, then some clients
> won't have their entry put back in the kernel's table, and they'll get -ESTALE.
>
> This is because the host is only considered for addition to the kernel's list
> of authenticated hosts when it makes a mount request. What we _ought_ to do is
> make that decision whenever we receive _any_ request that would otherwise be
> unauthenticated.
>
> So I've added a callback from the kernel to mountd for any request which would
> otherwise be refused. I've also added a new export flag NFSEXP_NEGATIVE so
> that mountd can let the kernel know about hosts/requests which actually should
> result in a return code of ESTALE.

I put the patches in knfsd 1.5. I made some small modifications.

>
> With these patches, knfsd no longer requires xtab or rmtab to maintain state
> across shutdown/startup - it will automatically add client entries to the
> kernel's table when they actually start to make NFS requests.
>
> I have yet to fix up exportfs, and to implement expiry of the negative entries
> (and of positive ones for that matter), but I've got it to the state where it
> no longer requires xtab or rmtab to work reliably, and it'll automatically
> reregister clients which ought to be authenticated, but aren't in the kernel's
> client list.
>
> This is work in progress, but I'm posting it for comments before I go and round
> up the loose ends. The patches are against knfsd-1.4.7, and 2.2.12 with the
> relevant patches included.
>
> Note the patch to net/sunrpc/svc.c, which allows RPC in from any host - I'd
> like a better way of doing that, if possible, without adding a separate
> netlink callback in the RPC layer. Is there a way that the nfsd service can
> register itself as being promiscuous?
>

It is a problem since some amd/autofs implementations depend
on it. Why do you have to disable it?

Thanks.

H.J.

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