Re: [nfsv4] "Courtesy locks"

Rick Macklem <rmacklem@uoguelph.ca> Mon, 13 September 2010 23:26 UTC

Return-Path: <rmacklem@uoguelph.ca>
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 D26A03A681D for <nfsv4@core3.amsl.com>; Mon, 13 Sep 2010 16:26:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.816
X-Spam-Level:
X-Spam-Status: No, score=-5.816 tagged_above=-999 required=5 tests=[AWL=0.183, BAYES_00=-2.599, J_CHICKENPOX_44=0.6, RCVD_IN_DNSWL_MED=-4]
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 PnkPjr+bG-9j for <nfsv4@core3.amsl.com>; Mon, 13 Sep 2010 16:26:13 -0700 (PDT)
Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by core3.amsl.com (Postfix) with ESMTP id 2A8253A6845 for <nfsv4@ietf.org>; Mon, 13 Sep 2010 16:26:13 -0700 (PDT)
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApwEAKVQjkyDaFvO/2dsb2JhbACDG58hs2ySDIEigyp0BIon
X-IronPort-AV: E=Sophos;i="4.56,361,1280721600"; d="scan'208";a="91734443"
Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 13 Sep 2010 19:26:38 -0400
Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 946B9B3F36; Mon, 13 Sep 2010 19:26:38 -0400 (EDT)
Date: Mon, 13 Sep 2010 19:26:38 -0400
From: Rick Macklem <rmacklem@uoguelph.ca>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Message-ID: <548088130.859928.1284420398542.JavaMail.root@erie.cs.uoguelph.ca>
In-Reply-To: <1284397332.6466.13.camel@heimdal.trondhjem.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-Originating-IP: [24.65.230.102]
X-Mailer: Zimbra 6.0.7_GA_2476.RHEL4 (ZimbraWebClient - SAF3 (Mac)/6.0.7_GA_2473.RHEL4_64)
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:26:15 -0000

> On Sun, 2010-09-12 at 23:22 -0400, Rick Macklem wrote:
> > > On Sun, 2010-09-12 at 12:21 -0400, david.noveck@emc.com wrote:
> > > C) We try to send a RENEW. If that fails, we try to send a
> > > SETCLIENTID
> > > that uses the same clientid and verifier as when we originally
> > > mounted
> > > the filesystem.
> > > After that, we try to replay all OPEN and LOCK calls.
> >
> > Doesn't expired imply a conflicting lock could have been issued and
> > then released by now. ie. It doesn't seem safe to re-acquire a byte
> > range lock. (My client re-acquires Opens because they are all
> > DENY_NONE,
> > so my client doesn't care about Opens with DENY_xxx, where xxx is
> > not NONE.)
> 
> We don't ever use deny modes in Linux.

Yep, the FreeBSD8 client doesn't either. Sorry for the confusion.
(ie. It always Opens with DENY_NONE.)

> 
> > >
> > > > C2) If you didn't answer (a) to (C1), are there any assumptions
> > > >     (of the sort mentioned in (S3) to (S6)) whose violation
> > > >     would
> > > >     cause problems?
> > >
> > > In principle not. We are supposed to be able to recover all locks
> > > on a
> > > per-open_stateid basis.
> > >
> > > IOW: if an open stateid, lock stateid or delegation stateid
> > > returns an
> > > error, we should be able to replay just the OPEN+LOCK requests
> > > that
> > > are
> > > required to allow the application to proceed.
> > >
> > > Note that we do not implement a SIGLOST feature in the case where
> > > the
> > > application has lost a lock (although we probably should). We
> > > never
> > > did
> > > it for NFSv3, and since nobody has really requested it for NFSv4
> > > either,
> > > we have deferred implementing it there too.
> >
> > So you are saying apps. might believe that they still hold a byte
> > range lock, even if another client might have acquired/released a
> > conflicting lock while it was network partitioned?
> 
> Yes. What I said above is that there is no mechanism in Linux (or
> POSIX
> for that matter) for notifying apps that they have lost their locks.
> Implementing SIGLOST might be one way to do so, but requires apps to
> be
> rewritten to make use of it.
> 
You could always, as the Governor of California might say:
"terminate them":-).

I haven't solved this for FreeBSD8 either. (It has no SIGLOST.) I
think what happens is:
- any further attempts at lokc ops fail because there isn't any
  open/lock state.
- I/O ops. fall back to using the special stateid of all 0s and
  succeed or fail at the whim of the server.

rick