Re: [nfsv4] "Courtesy locks"

Mike Mackovitch <macko@apple.com> Mon, 13 September 2010 23:59 UTC

Return-Path: <macko@apple.com>
X-Original-To: nfsv4@core3.amsl.com
Delivered-To: nfsv4@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id DA0EE3A6824 for <nfsv4@core3.amsl.com>; Mon, 13 Sep 2010 16:59:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.599
X-Spam-Level:
X-Spam-Status: No, score=-106.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QPqpFCNFHgtM for <nfsv4@core3.amsl.com>; Mon, 13 Sep 2010 16:59:54 -0700 (PDT)
Received: from mail-out4.apple.com (mail-out4.apple.com [17.254.13.23]) by core3.amsl.com (Postfix) with ESMTP id BC9D03A677E for <nfsv4@ietf.org>; Mon, 13 Sep 2010 16:59:54 -0700 (PDT)
Received: from relay16.apple.com (relay16.apple.com [17.128.113.55]) by mail-out4.apple.com (Postfix) with ESMTP id AC302AF3870E; Mon, 13 Sep 2010 17:00:20 -0700 (PDT)
X-AuditID: 11807137-b7b43ae00000547d-f1-4c8ebb135c30
Received: from m12.macko.edu (il0102b-dhcp52.apple.com [17.201.26.102]) (using TLS with cipher AES256-SHA (AES256-SHA/256 bits)) (Client did not present a certificate) by relay16.apple.com (Apple SCV relay) with SMTP id 51.CC.21629.41BBE8C4; Mon, 13 Sep 2010 17:00:20 -0700 (PDT)
Date: Mon, 13 Sep 2010 17:00:19 -0700
From: Mike Mackovitch <macko@apple.com>
To: Rick Macklem <rmacklem@uoguelph.ca>
Message-ID: <20100914000019.GA48838@m12.macko.edu>
References: <20100913160643.GA45938@wacko.local> <1463622341.860473.1284421117976.JavaMail.root@erie.cs.uoguelph.ca>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <1463622341.860473.1284421117976.JavaMail.root@erie.cs.uoguelph.ca>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-Brightmail-Tracker: AAAAAA==
Cc: nfsv4@ietf.org
Subject: Re: [nfsv4] "Courtesy locks"
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/nfsv4>
List-Post: <mailto:nfsv4@ietf.org>
List-Help: <mailto:nfsv4-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 13 Sep 2010 23:59:55 -0000

On Mon, Sep 13, 2010 at 07:38:38PM -0400, Rick Macklem wrote:
> > 
> > For the Mac OS X NFSv4 client:
> > 
> > > C1) When you get NFS4ERR_EXPIRED, what happens?
> > >
> > >     a) Assume all locks associated with lease have been released
> > >        that the client needs to create a new clientid?
> > >     b) Assume that it means one or more locks have been lost and
> > >        the client needs to determine what as gone and which are
> > >        still valid.
> > 
> > (b)
> > 
> > Upon receipt of NFS4ERR_EXPIRED the client will enter recovery mode
> > where we will attempt to reclaim all opens, all locks and delegated
> > state (if we didn't have non-delegated state that already covered it)
> > and drop/return any lingering delegations we had.
> 
> The FreeBSD8 server will only allow reclaim Ops during the grace
> period right after a reboot. It will return NFS4ERR_NO_GRACE for
> all reclaim Ops (Open with Claim_previous or Lock with the reclaim
> flag true) received outside of this grace period.
> 
> Do other servers allow this? (I thought the above was required
> behaviour?)

I'm not currently working on any NFSv4 server implementation, so I
can't answer your question.  :-)

But if the server is not allowed to process reclaim ops outside the
grace period then there's no hope of nicely handling the case where
the server's grace period passes before the client gets a chance to
reconnect to the server.

In the context of "courtesy locks" I don't think it makes any sense
for a server to keep the state around if it's going to tell the client
that the state expired but not allow the state to be reclaimed.
(Wasn't the point of the "courtesy" to allow them to be reclaimed if
there hadn't been any contention?)

Anyway, I'm simply coding our client to try to allow it to recover as
much state as the server will allow.

--macko