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

<david.noveck@emc.com> Fri, 20 August 2010 15:34 UTC

Return-Path: <david.noveck@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 2FF543A6AB6 for <nfsv4@core3.amsl.com>; Fri, 20 Aug 2010 08:34:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.409
X-Spam-Level:
X-Spam-Status: No, score=-5.409 tagged_above=-999 required=5 tests=[AWL=-0.669, BAYES_20=-0.74, 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 xo6uFSSg1oza for <nfsv4@core3.amsl.com>; Fri, 20 Aug 2010 08:34:52 -0700 (PDT)
Received: from mexforward.lss.emc.com (mexforward.lss.emc.com [128.222.32.20]) by core3.amsl.com (Postfix) with ESMTP id 11F8E3A6358 for <nfsv4@ietf.org>; Fri, 20 Aug 2010 08:34:51 -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.4.3/Switch-3.4.3) with ESMTP id o7KFZHdi029813 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Aug 2010 11:35:17 -0400
Received: from mailhub.lss.emc.com (mailhub.lss.emc.com [10.254.221.145]) by hop04-l1d11-si01.isus.emc.com (RSA Interceptor); Fri, 20 Aug 2010 11:35:07 -0400
Received: from corpussmtp5.corp.emc.com (corpussmtp5.corp.emc.com [128.221.166.229]) by mailhub.lss.emc.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id o7KFYq34001885; Fri, 20 Aug 2010 11:35:06 -0400
Received: from CORPUSMX50A.corp.emc.com ([128.221.62.39]) by corpussmtp5.corp.emc.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 20 Aug 2010 11:35:03 -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: Fri, 20 Aug 2010 11:35:02 -0400
Message-ID: <BF3BB6D12298F54B89C8DCC1E4073D80024B7187@CORPUSMX50A.corp.emc.com>
In-Reply-To: <20100819164448.GF30151@fieldses.org>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: [nfsv4] OPEN_DOWNGRADE and posix byte range locking issue
Thread-Index: Acs/vibhr6bdhGIuQT6bBq5GG5qjiQAvbX1Q
References: <1278545423.15524.26.camel@heimdal.trondhjem.org> <BF3BB6D12298F54B89C8DCC1E4073D8001ADE6C8@CORPUSMX50A.corp.emc.com> <1278623332.13551.47.camel@heimdal.trondhjem.org> <20100819164448.GF30151@fieldses.org>
From: david.noveck@emc.com
To: bfields@fieldses.org, Trond.Myklebust@netapp.com
X-OriginalArrivalTime: 20 Aug 2010 15:35:03.0411 (UTC) FILETIME=[42176430:01CB407D]
X-EMM-MHVC: 1
X-EMM-MFVC: 1
Cc: linux-nfs@vger.kernel.org, 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: Fri, 20 Aug 2010 15:34:53 -0000

It isn't the server's problem.  There is no way the server has access to
the Vfs opens as visible objects or as having the assignment of locks to
such fine-grained opens.

I'm kind of thinking that this shows we (Bruce, me, and rest of the
working group) made a mistake in that sort of a design in which we do
not allow multiple distinguished open objects for a given fh-owner pair.
Anyway the problems that it caused are pretty minor and we don't know
what problems would have been generated with an alternate design.  I
think this is something to look at in NFSv5 or the next NFSv4.1-style
minor version, if any. 

-----Original Message-----
From: J. Bruce Fields [mailto:bfields@fieldses.org] 
Sent: Thursday, August 19, 2010 12:45 PM
To: Trond Myklebust
Cc: Noveck, David; nfsv4@ietf.org; linux-nfs@vger.kernel.org
Subject: Re: [nfsv4] OPEN_DOWNGRADE and posix byte range locking issue

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

A bizarre variation: the linux server associates vfs opens with
stateid's.  Locks are performed on vfs opens, and the vfs will complain
if you attempt to close a file that still has locks associated with it.

The sequence

	open RW
	lock R
	open R
	open downgrade to R

would therefore be implemented at the vfs level as:

	open RW -> f
	lock R on f
	open R -> g
	close f

Oops.  We're stuck with ditching the lock (or erroring out) even though
it's still compatible with the new config option.

Well, I suppose this is my problem: either I should get a new vfs open
for the use of the lock, or represent the original RW open by two vfs
open's.

It's not something a unix-like client could do, I think, but I don't
think it's safe for me to assume I can reject it?

--b.