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

Trond Myklebust <trond.myklebust@fys.uio.no> Mon, 05 July 2010 00:33 UTC

Return-Path: <trond.myklebust@fys.uio.no>
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 DB5E43A67F8 for <nfsv4@core3.amsl.com>; Sun, 4 Jul 2010 17:33:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.166
X-Spam-Level:
X-Spam-Status: No, score=-6.166 tagged_above=-999 required=5 tests=[AWL=0.433, 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 ExJMiduGjSqB for <nfsv4@core3.amsl.com>; Sun, 4 Jul 2010 17:33:28 -0700 (PDT)
Received: from mail-out2.uio.no (mail-out2.uio.no [129.240.10.58]) by core3.amsl.com (Postfix) with ESMTP id A8FF13A67E3 for <nfsv4@ietf.org>; Sun, 4 Jul 2010 17:33:27 -0700 (PDT)
Received: from mail-mx1.uio.no ([129.240.10.29]) by mail-out2.uio.no with esmtp (Exim 4.69) (envelope-from <trond.myklebust@fys.uio.no>) id 1OVZcl-0008BL-6R; Mon, 05 Jul 2010 02:33:27 +0200
Received: from c-68-40-206-115.hsd1.mi.comcast.net ([68.40.206.115] helo=[192.168.1.29]) by mail-mx1.uio.no with esmtpsa (SSLv3:CAMELLIA256-SHA:256) user trondmy (Exim 4.69) (envelope-from <trond.myklebust@fys.uio.no>) id 1OVZck-00059d-Cr; Mon, 05 Jul 2010 02:33:27 +0200
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Rick Macklem <rmacklem@uoguelph.ca>
In-Reply-To: <Pine.GSO.4.63.1007041947180.1654@muncher.cs.uoguelph.ca>
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>
Content-Type: text/plain; charset="UTF-8"
Date: Sun, 04 Jul 2010 20:33:23 -0400
Message-ID: <1278290003.2851.9.camel@heimdal.trondhjem.org>
Mime-Version: 1.0
X-Mailer: Evolution 2.30.2 (2.30.2-1.fc13)
Content-Transfer-Encoding: 7bit
X-UiO-Ratelimit-Test: rcpts/h 2 msgs/h 1 sum rcpts/h 5 sum msgs/h 2 total rcpts 547 max rcpts/h 20 ratelimit 0
X-UiO-Spam-info: not spam, SpamAssassin (score=-5.0, required=5.0, autolearn=disabled, UIO_MAIL_IS_INTERNAL=-5, uiobl=NO, uiouri=NO)
X-UiO-Scanned: 2870DFD1BE5E4DDBC859BB67458465BC39EB109B
X-UiO-SPAM-Test: remote_host: 68.40.206.115 spam_score: -49 maxlevel 80 minaction 2 bait 0 mail/h: 1 total 245 max/h 6 blacklist 0 greylist 0 ratelimit 0
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.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, 05 Jul 2010 00:33:29 -0000

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