Re: [nfsv4] "Courtesy locks"

Trond Myklebust <Trond.Myklebust@netapp.com> Mon, 13 September 2010 17:02 UTC

Return-Path: <Trond.Myklebust@netapp.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 BE8D23A6A7C for <nfsv4@core3.amsl.com>; Mon, 13 Sep 2010 10:02:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.266
X-Spam-Level:
X-Spam-Status: No, score=-6.266 tagged_above=-999 required=5 tests=[AWL=-0.267, 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 xP5hQuuJypnK for <nfsv4@core3.amsl.com>; Mon, 13 Sep 2010 10:02:24 -0700 (PDT)
Received: from mx2.netapp.com (mx2.netapp.com [216.240.18.37]) by core3.amsl.com (Postfix) with ESMTP id D04633A6A7D for <nfsv4@ietf.org>; Mon, 13 Sep 2010 10:02:24 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="4.56,359,1280732400"; d="scan'208";a="449489385"
Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 13 Sep 2010 10:02:32 -0700
Received: from svlrsexc2-prd.hq.netapp.com (svlrsexc2-prd.hq.netapp.com [10.57.115.31]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id o8DH2RDA008035; Mon, 13 Sep 2010 10:02:32 -0700 (PDT)
Received: from SACMVEXC2-PRD.hq.netapp.com ([10.99.115.18]) by svlrsexc2-prd.hq.netapp.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 13 Sep 2010 10:02:28 -0700
Received: from 10.58.61.131 ([10.58.61.131]) by SACMVEXC2-PRD.hq.netapp.com ([10.99.115.16]) with Microsoft Exchange Server HTTP-DAV ; Mon, 13 Sep 2010 17:02:12 +0000
Received: from heimdal.trondhjem.org by SACMVEXC2-PRD.hq.netapp.com; 13 Sep 2010 13:02:12 -0400
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Rick Macklem <rmacklem@uoguelph.ca>
In-Reply-To: <684147485.798461.1284348151294.JavaMail.root@erie.cs.uoguelph.ca>
References: <684147485.798461.1284348151294.JavaMail.root@erie.cs.uoguelph.ca>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Organization: NetApp
Date: Mon, 13 Sep 2010 13:02:12 -0400
Message-ID: <1284397332.6466.13.camel@heimdal.trondhjem.org>
Mime-Version: 1.0
X-Mailer: Evolution 2.30.3 (2.30.3-1.fc13)
X-OriginalArrivalTime: 13 Sep 2010 17:02:28.0895 (UTC) FILETIME=[728EBAF0:01CB5365]
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 17:02:25 -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.

> > 
> > > 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.

Trond