rpc.lockd spinning; much breakage
Terry Lambert
tlambert2 at mindspring.com
Tue May 13 00:26:01 PDT 2003
Don Lewis wrote:
> > Normally, lockf(1) gets back EAGAIN and polls for the lock to be
> > released. I'm not sure which case in the client rpc.lockd(8) it is.
> > Since Solaris doesn't support O_EXLOCK and lockf(1) it wasn't easy for
> > me to test, but since the server returns the same result from FreeBSD
> > and Solaris, I'm guessing it's a client-side mapping problem.
> > Presumably some instance of nlm_denied should return EAGAIN instead.
>
> I think this gets an nlm4_denied response, which is handled by the
> following code in lock_answer():
Historically, this was implemented using O_EXCL to ensure only
a single process was allowed to open the file at a time. It may
be that that's what's being expected over the wire.
I'm pretty sure AIX implemented this by putting an advisory
range lock over the entirety of the file; but AIX has a
couple of other quirks in the NFS processing that make it
less than ideal as a reference implementation.
As of Solaris 5.x, the man pages claim that O_EXCL without
O_CREAT has undefined behaviour. The SCO manual pages are
pretty clear that it means exclusive use (FWIW; do a Google
search on "O_EXCL" and "exclusive use").
-- Terry
More information about the freebsd-current
mailing list