Re: [nfsv4] OPEN_DOWNGRADE and posix byte range locking issue
Trond Myklebust <Trond.Myklebust@netapp.com> Thu, 08 July 2010 21:09 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 3F4F13A68F3 for <nfsv4@core3.amsl.com>; Thu, 8 Jul 2010 14:09:46 -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 hmedvR1w74x9 for <nfsv4@core3.amsl.com>; Thu, 8 Jul 2010 14:09:45 -0700 (PDT)
Received: from mx2.netapp.com (mx2.netapp.com [216.240.18.37]) by core3.amsl.com (Postfix) with ESMTP id 692883A67B8 for <nfsv4@ietf.org>; Thu, 8 Jul 2010 14:09:45 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="4.53,560,1272870000"; d="scan'208";a="398485229"
Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 08 Jul 2010 14:09:50 -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 o68L9nVH020785; Thu, 8 Jul 2010 14:09:49 -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); Thu, 8 Jul 2010 14:09:49 -0700
Received: from 10.58.60.185 ([10.58.60.185]) by SACMVEXC2-PRD.hq.netapp.com ([10.99.115.16]) with Microsoft Exchange Server HTTP-DAV ; Thu, 8 Jul 2010 21:08:53 +0000
Received: from heimdal.trondhjem.org by SACMVEXC2-PRD.hq.netapp.com; 08 Jul 2010 17:08:53 -0400
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Noveck_David@emc.com
In-Reply-To: <BF3BB6D12298F54B89C8DCC1E4073D8001ADE6C8@CORPUSMX50A.corp.emc.com>
References: <1278545423.15524.26.camel@heimdal.trondhjem.org> <BF3BB6D12298F54B89C8DCC1E4073D8001ADE6C8@CORPUSMX50A.corp.emc.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Organization: NetApp
Date: Thu, 08 Jul 2010 17:08:52 -0400
Message-ID: <1278623332.13551.47.camel@heimdal.trondhjem.org>
Mime-Version: 1.0
X-Mailer: Evolution 2.30.2 (2.30.2-1.fc13)
X-OriginalArrivalTime: 08 Jul 2010 21:09:49.0706 (UTC) FILETIME=[E6B186A0:01CB1EE1]
Cc: nfsv4@ietf.org
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 21:09:46 -0000
I think that it might be better to disallow automatically freeing locks since the server does not always know which lock_owner (!= open_owner) is affected by the close() system call that triggered the OPEN_DOWNGRADE on the client. In the case of CLOSE, the choice of lock_owners is unambiguous, since it is very clear that all lock stateids that were associated to the open stateid in question must be released. Cheers Trond On Thu, 2010-07-08 at 15:50 -0400, Noveck_David@emc.com wrote: > 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 > > _______________________________________________ > nfsv4 mailing list > nfsv4@ietf.org > https://www.ietf.org/mailman/listinfo/nfsv4
- [nfsv4] OPEN_DOWNGRADE and posix byte range locki… Trond Myklebust
- Re: [nfsv4] OPEN_DOWNGRADE and posix byte range l… Noveck_David
- Re: [nfsv4] OPEN_DOWNGRADE and posix byte range l… Trond Myklebust
- Re: [nfsv4] OPEN_DOWNGRADE and posix byte range l… J. Bruce Fields
- Re: [nfsv4] OPEN_DOWNGRADE and posix byte range l… david.noveck
- Re: [nfsv4] OPEN_DOWNGRADE and posix byte range l… J. Bruce Fields