Re: [nfsv4] OPEN_DOWNGRADE and posix byte range locking issue

<Noveck_David@emc.com> Thu, 08 July 2010 19:50 UTC

Return-Path: <Noveck_David@emc.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 4CB2E3A68AC for <nfsv4@core3.amsl.com>; Thu, 8 Jul 2010 12:50:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.599
X-Spam-Level:
X-Spam-Status: No, score=-6.599 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599, 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 CPW866hQdbIm for <nfsv4@core3.amsl.com>; Thu, 8 Jul 2010 12:50:32 -0700 (PDT)
Received: from mexforward.lss.emc.com (mexforward.lss.emc.com [128.222.32.20]) by core3.amsl.com (Postfix) with ESMTP id 578FA3A68B3 for <nfsv4@ietf.org>; Thu, 8 Jul 2010 12:50:32 -0700 (PDT)
Received: from hop04-l1d11-si01.isus.emc.com (HOP04-L1D11-SI01.isus.emc.com [10.254.111.54]) by mexforward.lss.emc.com (Switch-3.3.2/Switch-3.1.7) with ESMTP id o68Joas3017239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Jul 2010 15:50:36 -0400
Received: from mailhub.lss.emc.com (numailhub.lss.emc.com [10.254.144.16]) by hop04-l1d11-si01.isus.emc.com (RSA Interceptor); Thu, 8 Jul 2010 15:50:26 -0400
Received: from corpussmtp3.corp.emc.com (corpussmtp3.corp.emc.com [10.254.169.196]) by mailhub.lss.emc.com (Switch-3.4.2/Switch-3.3.2mp) with ESMTP id o68JoKSm007242; Thu, 8 Jul 2010 15:50:26 -0400
Received: from CORPUSMX50A.corp.emc.com ([128.221.62.41]) by corpussmtp3.corp.emc.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 8 Jul 2010 15:50:23 -0400
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Date: Thu, 08 Jul 2010 15:50:22 -0400
Message-ID: <BF3BB6D12298F54B89C8DCC1E4073D8001ADE6C8@CORPUSMX50A.corp.emc.com>
In-Reply-To: <1278545423.15524.26.camel@heimdal.trondhjem.org>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: [nfsv4] OPEN_DOWNGRADE and posix byte range locking issue
Thread-Index: AcseLvRaLfhon55yRCOojo7xsu6xuwAou1yA
References: <1278545423.15524.26.camel@heimdal.trondhjem.org>
From: Noveck_David@emc.com
To: Trond.Myklebust@netapp.com, nfsv4@ietf.org
X-OriginalArrivalTime: 08 Jul 2010 19:50:23.0319 (UTC) FILETIME=[CDB49670:01CB1ED6]
X-EMM-EM: Active
Subject: Re: [nfsv4] OPEN_DOWNGRADE and posix byte range locking issue
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: Thu, 08 Jul 2010 19:50:36 -0000

Makes sense to me.

18.10.4 of RFC 5661 says:

   LOCK operations are subject to permission checks and to checks
   against the access type of the associated file.  However, the
   specific right and modes required for various types of locks reflect
   the semantics of the server-exported file system, and are not
   specified by the protocol. 

Given that LOCK may exclude locks for write on files not open for write,
it makes sense that downgrade whereby a file can become
not-open-for-write when it previously was, has to reject a request which
would violate the invariant.

Sounds like we need a paragraph in DOWNGRADE explaining the issue as
well as adding the error to the list.

I think there is a another potential issue here.  CLOSE is allowed to
(but not required to) release byte-range locks.  I think windows does
that.

The issue I'm wondering about is whether a server is allowed to release
locks for write as a valid response to DOWNGRADE.  This is separate from
the issue of LOCKS_HELD, which I agree it needs to be able to do.  I
think we also agree that a server may allow the write locks to stay.
The interesting question is whether there is a third choice: silently
getting rid of the locks that have become inappropriate to the new open
mode.  

When we fix this, we should be clear on what is and isn't allowed.


-----Original Message-----
From: nfsv4-bounces@ietf.org [mailto:nfsv4-bounces@ietf.org] On Behalf
Of Trond Myklebust
Sent: Wednesday, July 07, 2010 7:30 PM
To: nfsv4@ietf.org
Subject: [nfsv4] OPEN_DOWNGRADE and posix byte range locking issue

Neither RFC3530, nor RFC5661 appear to list NFS4ERR_LOCKS_HELD as a
valid response when the client calls OPEN_DOWNGRADE.

The question is: what should the server then do if the NFS client holds
a WRITE_LT lock, but then asks for an OPEN_DOWNGRADE to
OPEN4_SHARE_ACCESS_READ. I understand that this is sanctioned in Windows
server environments, but it should definitely be forbidden in a POSIX
environment, and NFS4ERR_LOCKS_HELD would appear to fit the bill...

 Trond


_______________________________________________
nfsv4 mailing list
nfsv4@ietf.org
https://www.ietf.org/mailman/listinfo/nfsv4