Subject: Errors for graceless and other clumsy reclaims

From: "Noveck, Dave" <[email-masked]>
Date: Thu, 14 Jun 2001 08:33:43 -0700

The spec says that if a client does a reclaim-type
locking operation, and we are beyond the the grace
period, the server is not to grant the request
unless it can be assured that no conflicting lock 
was ever granted, even when there is currently no
conflicting lock at the time of the request.

So the question that this raises is what is the
error returned in this case?  I had assumed that
this was a normal denial (i.e. NFS4ERR_DENIED
for LOCK and NFS4ERR_SHARED_DENIED for OPEN but
that isn't said explicitly).  Now I'm wondering if
this is right.

First of all, there may be no actual conflicting
lock, so DENIED and the conflicting lock information
is not going to be available.  I know you can create
some lies but still...  Also, one typical response to
DENIED is to poll and this DENIED is never going away.

One answer to this is that DENIED in response to reclaim
is fatal (i.e. no polling) but I'd feel better if we
had a richer error set.

One case where this came up recently was a test in which
someone did an OPEN (outside the grace period so that's
fine) and then a LOCK specifying reclaim.  Since we don't
have the infrastructure that would enable us to grant such 
locks, we would deny it.  However the interesting thing is
that the facts (i.e. reclaim lock within non-reclaimed 
open) prove that the client is lying to us.  Other 
implementations may have more information and could determine
this in other situations.

I would feel better about the implementations' ability to 
get this critical part of the protocol (i.e. reclaim) working 
correctly and to diagnose any problems, if we distinguished 
the following errors from ordinary denial and from each other:

     NFS4ERR_NO_GRACE -- reclaim outside grace period where the
                         guarantee required for the lock to be
                         granted cannot be given.
     NFS4ERR_RECLAIM_BAD -- your reclaim is a bare-faced lie.  Get
                            out of here.
     NFS4ERR_RECLAIM_CONFLICT -- your reclaim encountered a conflict
                                 which indicates that some client is
                                 lying but I don't know who.

---

From: Spencer Shepler <[email-masked]>
Date: Fri, 15 Jun 2001 16:47:18 -0500

> DENIED is to poll and this DENIED is never going away.

Correct.  The error set does not cover this particular case.

> is fatal (i.e. no polling) but I'd feel better if we

I agree.

>                                  lying but I don't know who.

These seem like a reasonable first stab.  I will add them to the error
list and update the LOCK/OPEN operations.

-- 

- Spencer -