Re: [nfsv4] can a server replace a read deleg with a write deleg?

<david.noveck@emc.com> Fri, 26 August 2011 14:29 UTC

Return-Path: <david.noveck@emc.com>
X-Original-To: nfsv4@ietfa.amsl.com
Delivered-To: nfsv4@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1A59E21F8BB1 for <nfsv4@ietfa.amsl.com>; Fri, 26 Aug 2011 07:29:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.524
X-Spam-Level:
X-Spam-Status: No, score=-6.524 tagged_above=-999 required=5 tests=[AWL=0.075, BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c4fUggG9pggy for <nfsv4@ietfa.amsl.com>; Fri, 26 Aug 2011 07:29:01 -0700 (PDT)
Received: from mexforward.lss.emc.com (mexforward.lss.emc.com [128.222.32.20]) by ietfa.amsl.com (Postfix) with ESMTP id 25BC221F8B82 for <nfsv4@ietf.org>; Fri, 26 Aug 2011 07:29:00 -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 p7QEUB8T003892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 26 Aug 2011 10:30:11 -0400
Received: from mailhub.lss.emc.com (mailhub.lss.emc.com [10.254.222.130]) by hop04-l1d11-si01.isus.emc.com (RSA Interceptor); Fri, 26 Aug 2011 10:29:57 -0400
Received: from mxhub06.corp.emc.com (mxhub06.corp.emc.com [128.221.46.114]) by mailhub.lss.emc.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p7QETu9f013095; Fri, 26 Aug 2011 10:29:57 -0400
Received: from mx31a.corp.emc.com ([169.254.1.28]) by mxhub06.corp.emc.com ([128.221.46.114]) with mapi; Fri, 26 Aug 2011 10:29:56 -0400
From: david.noveck@emc.com
To: trond.myklebust@fys.uio.no, rmacklem@uoguelph.ca
Date: Fri, 26 Aug 2011 10:34:43 -0400
Thread-Topic: [nfsv4] can a server replace a read deleg with a write deleg?
Thread-Index: Acsb2bVfRBtxvwlqQoWkTGUnirmfBlIIHiww
Message-ID: <5DEA8DB993B81040A21CF3CB332489F68146A47B@MX31A.corp.emc.com>
References: <Pine.GSO.4.63.1007041217520.6453@muncher.cs.uoguelph.ca><1278260672.29898.13.camel@heimdal.trondhjem.org><Pine.GSO.4.63.1007041947180.1654@muncher.cs.uoguelph.ca> <1278290003.2851.9.camel@heimdal.trondhjem.org>
In-Reply-To: <1278290003.2851.9.camel@heimdal.trondhjem.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-EMM-MHVC: 1
Cc: nfsv4@ietf.org
Subject: Re: [nfsv4] can a server replace a read deleg with a write deleg?
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/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, 26 Aug 2011 14:29:02 -0000

I can see that this is clearly stated but I'm coming to the conclusion that it is a mistake.

I don't know that means it is an erratum that can be fixed in a bis, but I do think
We should be thinking about whether the protocol should work that way, and think
about what we want to do about this in v4.x going forward.

When I get a read delegation, I'm assured that nobody else is changing the file.

I don't need an assurance that I'm not changing the file.  I know whether I'm changing
the file.   

It could be that this restriction helps the others who have a read delegation but it
doesn't.  If I had no delegation, then when I opened for write, all of clients 
Holding read delegations would have their delegations recalled.  That make sense.

Now if I also hold a read delegation, then the spec says, as Trond points out,
That I will lose mine as well.  The question is "why?"  It can't be to inform me
that I'm writing.  I know that.

The problem here is that the protocol as now specified, cannot give you a delegation-based
assurance that you are the only one writing.  You can get an open-based non-revocable
assurance that you are the only writer by opening for write with deny-write, but
it is anomalous that you can't get a delegation-style assurance of this.

I accept that the spec says this clearly but does anybody know any good reason that it
should say that?  If it didn't, would the protocol be more or less useful?

-----Original Message-----
From: nfsv4-bounces@ietf.org [mailto:nfsv4-bounces@ietf.org] On Behalf Of Trond Myklebust
Sent: Sunday, July 04, 2010 8:33 PM
To: Rick Macklem
Cc: nfsv4@ietf.org
Subject: Re: [nfsv4] can a server replace a read deleg with a write deleg?

On Sun, 2010-07-04 at 19:54 -0400, Rick Macklem wrote:
> 
> On Sun, 4 Jul 2010, Trond Myklebust wrote:
> 
> >
> > I read RFC3530 as being perfectly clear on this.
> >
> > In section 9.4 it explicitly states that the client _cannot_ make any
> > changes to the contents or attributes of the file if it holds a read
> > delegation.
> >
> 
> Ok, here are 2 paras from page 103:
>     When a client has a read open delegation, it may not make any changes
>     to the contents or attributes of the file but it is assured that no
>     other client may do so.  When a client has a write open delegation,
>     it may modify the file data since no other client will be accessing
>     the file's data.  The client holding a write delegation may only
>     affect file attributes which are intimately connected with the file
>     data:  size, time_modify, change.
> 
> I see this as saying the read open delegation doesn't allow writing
> to the file, but I don't see it saying "the client can't open the
> file for writing against the server without first returning the
> delegation". (Btw, I have no problem with it saying that, I just
> didn't get that from the above para, especially given what it says
> in the next para.)
> 
>     When a client has an open delegation, it does not send OPENs or
>     CLOSEs to the server but updates the appropriate status internally.
> -> For a read open delegation, opens that cannot be handled locally
>     (opens for write or that deny read access) must be sent to the
>     server.
> 
> I see "->" simply saying that the open has to be done against the
> server. If the read open delegation must be returned for the open
> to be done, shouldn't it state that explicitly.
> 
> > In section 9.4.4 it states that the server must recall the delegation in
> > the event of a conflicting OPEN or READ/WRITE w/ special stateids.
> >
> If the open for writing is from the same client that holds the read open
> delegation, it didn't hit me as a "conflict". I would have thought a
> conflicting OPEN would have been one from a different client?

The client is requesting access to do something which Section 9.4
expressly forbids it to do while holding a read delegation (i.e. to
write to/modify the file). How can that not be a conflict? RFC 3530
makes no difference anywhere between a client holding a read delegation
and requesting to change the file or any other client trying to do the
same. The result of any such request should be a recall if the client
has not already returned the delegation.

Now, once the delegation has been returned (or forcefully revoked), the
server is quite free to respond to the client's OPEN for write request
by handing out a write delegation, if the conditions allow for it...

Cheers
  Trond

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