Re: [nfsv4] RFC 7530: Filehandle of opened file after the REMOVE

David Noveck <davenoveck@gmail.com> Mon, 02 January 2017 14:26 UTC

Return-Path: <davenoveck@gmail.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 C068F129618 for <nfsv4@ietfa.amsl.com>; Mon, 2 Jan 2017 06:26:26 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C1vh1Ef-7QO0 for <nfsv4@ietfa.amsl.com>; Mon, 2 Jan 2017 06:26:24 -0800 (PST)
Received: from mail-oi0-x229.google.com (mail-oi0-x229.google.com [IPv6:2607:f8b0:4003:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2045D1295CB for <nfsv4@ietf.org>; Mon, 2 Jan 2017 06:26:24 -0800 (PST)
Received: by mail-oi0-x229.google.com with SMTP id 3so299489410oih.1 for <nfsv4@ietf.org>; Mon, 02 Jan 2017 06:26:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XtGJ/fbaNE2yEWWgcYJANhXmr0lX19pGjibv6bpLpIk=; b=Rf9PHl9pheADH/I3BnIDxD0g4cTDhHT3NQDRkHhvAiS9F3AZ0Yt6VEpzNFLXH1OPC8 7BJ8y0tO1ax/3+Px5jWqOg0TjG5UC8tqWlH31yr+gA6g1wesG0qU8tZYPvfIY6NPu9Xu KM8Muw0gP02hqLrfvAFRXHI+uqkzJ0iw3VvaG6KHOrJuEKskRas/z8guo5ooZMclIZ3H 9KN8E24FvQWSujQr0NnTLFS/MCHneWOkagsDEsbmWvJaPHMKykIEl4/YIqbqqSz73VaG uubnYF14pa5VVDj4GhQ+r6Hen4Z044xQaNRBK2w2pgXlHBD++CpNxXDoUwFtnQ/v1/lD aJ8A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XtGJ/fbaNE2yEWWgcYJANhXmr0lX19pGjibv6bpLpIk=; b=c7Sm/0RnZQ3VhsyFGRPEsZDFP1HKB7140+EV4OFK6AkyjdqguydkAatMZxD6Nj9kEx jlth8eSSdZBaZVgsCy58EJsj8iS1E8DPdqCVNfsvnk8uSMMOHxAy7lII6TEhZUy5udO5 tp24LGw3rr/P+nR/zVuwLs/6aTptMleDIrloOJbOZWGDgHaf5FI+r51pJFldZ4l6pNcN fIulUsLsRpjOFPKkjPCpYgzdALAQFk9REzceGDkBB89Ps2e39olt421iEbQsaUBw8w3t LAPZXLwgjH8/fewSRpBQMUEpevX1r2RDQhdzO1yYSEAgdFG4+zl360DU7cnXLWEbruN0 NILg==
X-Gm-Message-State: AIkVDXIrXpb+LGsdKHBf3EX8YluK0GMdzqqdYn8sJBwyDXTy8QjNK/d4FBePAd/wSqYj9yq/OZSMdQdHveN91g==
X-Received: by 10.157.37.54 with SMTP id k51mr26485023otb.162.1483367183246; Mon, 02 Jan 2017 06:26:23 -0800 (PST)
MIME-Version: 1.0
Received: by 10.182.137.202 with HTTP; Mon, 2 Jan 2017 06:26:21 -0800 (PST)
In-Reply-To: <6B1462D8-4688-459C-8794-A64E182ADDC4@gmail.com>
References: <20161213171902.Horde.MkS1YMOM6VpxA0Z7rSMTe7P@mail.telka.sk> <CAABAsM5L0xdKodxk1dRSugLyROzn2JzgDkq6kdHE0LuGcfh++A@mail.gmail.com> <20161213181734.Horde.EqgB09El8rupnkesIQaBwJ3@mail.telka.sk> <CADaq8jcq2C0o8EWXoGjxDn58sV_J+-SP-=rj934Se-DV69b-pw@mail.gmail.com> <20161214112112.Horde.aPh8AjT6iWRl37CULwihyV7@mail.telka.sk> <CAABAsM7v6y0bsb0jKzfvobkUjniTLhM3uv8FYjo07HcLD2004w@mail.gmail.com> <20161227144414.GA32002@fieldses.org> <CADaq8jck14SKL6Ua9QxbqPyX1=1aaA7+76wv-__EWFvh7ZcEJA@mail.gmail.com> <C496AE44-0F27-4B66-A1F6-A76AEAFD7A90@gmail.com> <20161229024703.GA21325@fieldses.org> <20161229074830.GA3002@lst.de> <CADaq8jd__SJHP-4aJPbW9GscKRc6cwSe26VYt3w_GPcpuN3QHQ@mail.gmail.com> <c5251671-2408-eb7e-69ab-7b4eeda35f03@talpey.com> <YTXPR01MB01893591AC828FB15E2D8C4CDD6C0@YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM> <CAABAsM5g8Y_vPMC5Kyc9s7zErw-7CydKNf4V_-qbUjjP=_yS5A@mail.gmail.com> <CADaq8jfGCEKWRv8pb3VMZFtLN27dC_EewY=h448VNcBJkGFVQA@mail.gmail.com> <6B1462D8-4688-459C-8794-A64E182ADDC4@gmail.com>
From: David Noveck <davenoveck@gmail.com>
Date: Mon, 02 Jan 2017 09:26:21 -0500
Message-ID: <CADaq8jeAPSFG2zsXvD9FSMg7WOdN1dJNudazTAJGGYwqRHRbhg@mail.gmail.com>
To: Trond Myklebust <trondmy@gmail.com>
Content-Type: multipart/alternative; boundary="001a114102cc076acb05451d5617"
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/F-iRXozYcJpby2ZiG0QkA3arBnE>
Cc: Tom Talpey <tom@talpey.com>, Rick Macklem <rmacklem@uoguelph.ca>, IETF NFSv4 WG Mailing List <nfsv4@ietf.org>
Subject: Re: [nfsv4] RFC 7530: Filehandle of opened file after the REMOVE
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.17
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: <https://mailarchive.ietf.org/arch/browse/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, 02 Jan 2017 14:26:27 -0000

> See:
> https://tools.ietf.org/html/rfc7530#section-10.4.4

Thanks.

> Note that the above special case appears only to apply to _directories_.
It is not qualifying the “RENAME request for the file as either source or
target…”.

I got confused about this.  I think I somehow conflated this with the
material in the bulleted items in Section 16.26.5.  I somehow assumed that
the text would indicate that a delegation allowing local opens would have
to be recalled to enable the server to determine whether the directory
"SHOULD NOT" or "SHOULD" be deleted.  THere is no such  text in RFC7530
now, but I'm not sure what to do about that.

>There is also https://tools.ietf.org/html/rfc7530#section-10.4

   When a single client holds an OPEN_DELEGATE_READ delegation, it is
   assured that no other client may modify the contents or attributes of
   the file.  If more than one client holds an OPEN_DELEGATE_READ
   delegation, then the contents and attributes of that file are not
   allowed to change.  When a client has an OPEN_DELEGATE_WRITE
   delegation, it may modify the file data since no other client will be
   accessing the file's data.  The client holding an OPEN_DELEGATE_WRITE
   delegation may only affect file attributes that are intimately
   connected with the file data: size, time_modify, and change.


> That last sentence implies (but does not state explicitly) that the
client must give up the write delegation
> if it wants to modify other file attributes.

I don't think that was the intention, although I can see how it might be
read that way.

I read this as saying that the client holding a WRITE delegation may only
affect those data-related attributes locally since it has a guarantee that
no other clients are looking at them (and that CB_GETATTR will be used when
appropriate).  Other attributes (including named attributes which are not
explicitly included or excluded) are outside the scope of the delegation.
I don't see that a client holding a WRITE delegation has to give it back
simple because he is changing some other attribute.  I think he can do the
SETATTR normally in this case.  I also note that section 10.4.4. says "SETATTR
issued by another client", suggesting that one issued by the client holding
the delegation is OK.


> https://tools.ietf.org/html/rfc5661#section-10.4.4

It is Section 10.4.4 in both 7530 and 5661.  Coincidence ... or
something else? :-)


>The text in RFC7530 was a straight cut n’ paste job from RFC5661

It appears that RFC5661 was a cut n' paste from RFC3530, so it isn't
clear whether the RFC7530 text was derived from RFC3530 (which makes
sense)  or from RFC5661, which doesn't, since v4.0 and v4.1 are different
protocols.

The problem is the inappropriate cut n' paste from RFC3530 to RFC5661.
It appears that this was a mistake although I don't think we can deal with
this
via an errata.  It is worth noting that the list in question is introduced
by the
the non-RFC2119 phrase "The following events necessitate the recall
of an open delegation".

On Mon, Jan 2, 2017 at 7:52 AM, Trond Myklebust <trondmy@gmail.com> wrote:

>
> On Jan 2, 2017, at 13:11, David Noveck <davenoveck@gmail.com> wrote:
>
> > If you read RFC7530, then the client is expected to return the
> delegation before doing any form of RENAME or REMOVE
>
> Could you be more specific about where you saw that?  I tried to find it
> but didn't succeed.  In fact, with regard to RENAME, the text makes the
> need for a recall conditional about whether the server in question might
> disallow RENAMEs depending on what existing opens deny.  I don't remember
> any statement about expectations regarding delegation return in advance of
> these ops.
>
>
> See:
> https://tools.ietf.org/html/rfc7530#section-10.4.4
>
> 10.4.4 <https://tools.ietf.org/html/rfc7530#section-10.4.4>.  Recall of Open Delegation
>
>    The following events necessitate the recall of an open delegation:
>
>    o  Potentially conflicting OPEN request (or READ/WRITE done with
>       "special" stateid)
>
>    o  SETATTR issued by another client
>
>    o  REMOVE request for the file
>
>    o  RENAME request for the file as either source or target of the
>       RENAME
>
>    Whether a RENAME of a directory in the path leading to the file
>    results in the recall of an open delegation depends on the semantics
>    of the server file system.  If that file system denies such RENAMEs
>    when a file is open, the recall must be performed to determine
>    whether the file in question is, in fact, open.
>
>
> Note that the above special case appears only to apply to _directories_.
> It is not qualifying the “RENAME request for the file as either source or
> target…”.
>
> There is also https://tools.ietf.org/html/rfc7530#section-10.4
>
>    When a single client holds an OPEN_DELEGATE_READ delegation, it is
>    assured that no other client may modify the contents or attributes of
>    the file.  If more than one client holds an OPEN_DELEGATE_READ
>    delegation, then the contents and attributes of that file are not
>    allowed to change.  When a client has an OPEN_DELEGATE_WRITE
>    delegation, it may modify the file data since no other client will be
>    accessing the file's data.  The client holding an OPEN_DELEGATE_WRITE
>    delegation may only affect file attributes that are intimately
>    connected with the file data: size, time_modify, and change.
>
>
> That last sentence implies (but does not state explicitly) that the client
> must give up the write delegation if it wants to modify other file
> attributes.
>
>
> > since the server has no stateid or session id with which to identify the
> origin of the RPC call.
>
> True statement about an annoying aspect of v4.0, but I'm not clear about
> where it appears in RFC7530.
>
>
> It doesn’t, but that was the main argument for recalling the delegation in
> the cases.
>
>
> > It is less obvious that this needs be the case for NFSv4.x (x>0), but I
> can't remember seeing any changes to those texts in RFC5661.
>
> Once we find the text in RFC7530, we can address RFC5661.  If the text you
> recall seeing in RFC7530 appears unchanged in RFC5661, we might need an
> errata.
>
>
>
> https://tools.ietf.org/html/rfc5661#section-10.4.4
>
>
> The text in RFC7530 was a straight cut n’ paste job from RFC5661.
>
>
> On Sun, Jan 1, 2017 at 6:36 PM, Trond Myklebust <trondmy@gmail.com> wrote:
>
>>
>>
>> On 2 January 2017 at 00:19, Rick Macklem <rmacklem@uoguelph.ca> wrote:
>>
>>> Tom Talpey wrote:
>>> On 1/1/2017 8:13 AM, David Noveck wrote:
>>> > Btw, my preferred title for such a document, almost certain to be
>>> > rejected, is "Silly Rename Must Die" :-)
>>> Actually replying to a random thread, mostly Dave's...
>>>
>>> A case that I wasn't clear on w.r.t. this is:
>>> - The client holds a delegation for the file.
>>> - The client issues opens locally w.r.t. this delegation.
>>> - A process/thread on the client does a "Remove" of the file.
>>>
>>> Is the client expected to acquire Opens against the server and return the
>>> Delegation? (This seems like more work than just doing good old
>>> sillyrename?)
>>> - Or does a Delegation have the same effect as an Open against the file
>>> on the
>>>   server.
>>>
>>
>> If you read RFC7530, then the client is expected to return the delegation
>> before doing any form of RENAME or REMOVE, since the server has no stateid
>> or session id with which to identify the origin of the RPC call.
>>
>> It is less obvious that this needs be the case for NFSv4.x (x>0), but I
>> can't remember seeing any changes to those texts in RFC5661.
>>
>> Cheers
>>   Trond
>>
>> _______________________________________________
>> nfsv4 mailing list
>> nfsv4@ietf.org
>> https://www.ietf.org/mailman/listinfo/nfsv4
>>
>>
>
>