Re: rpc.lockd spinning; much breakage

From: Don Lewis <truckman_at_FreeBSD.org>
Date: Tue, 13 May 2003 22:45:32 -0700 (PDT)
On 13 May, Robert Watson wrote:
> On Tue, 13 May 2003, Don Lewis wrote:

> So that change sounds like a winner for that issue.  This leaves the
> problem of getting EACCES back for locks contended by an NFS client
> against consumers directly on the server, rather than the client retrying. 

Non-blocking, blocking, or both?  What about the case if the lock is
held by another client?

I think the following code in lock_answer() is the culprit:

        if (version == NLM_VERS4)
                switch (result) {
                case nlm4_granted:
                        ans.la_errno = 0;
                        break;
                default:
                        ans.la_errno = EACCES;
                        break;
                case nlm4_denied:
                        if (pid_p == NULL)
                                ans.la_errno = EACCES;
                        else {
                                /* this is an answer to a nlm_test msg */
                                ans.la_set_getlk_pid = 1;
                                ans.la_getlk_pid = *pid_p;
                                ans.la_errno = 0;
                        }
                        break;

I think the last assignment to ans.la_errno in this snippet of code
should be EAGAIN.  I'm working under the assumption that this case
handles a non-blocking lock being denied, and that the blocking case is
handled by nlm4_blocked a bit further down.  It looks like pid_p is only
used to implement fcntl(fd, F_GETLK, ...).  If the code above is
incorrect, the NFSv2 code below will need a similar fix.

I don't know if the the client will retry in the blocking case or if the
server side will have to grow the code to poll any local locks that it
might encounter.
Received on Tue May 13 2003 - 20:45:43 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:07 UTC