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

Trond Myklebust <trondmy@gmail.com> Mon, 02 January 2017 14:42 UTC

Return-Path: <trondmy@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 3F3E5129629 for <nfsv4@ietfa.amsl.com>; Mon, 2 Jan 2017 06:42:35 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.699
X-Spam-Level:
X-Spam-Status: No, score=-1.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, FREEMAIL_REPLY=1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=no 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 v6nDYmnngEza for <nfsv4@ietfa.amsl.com>; Mon, 2 Jan 2017 06:42:33 -0800 (PST)
Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) (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 3FA1E129627 for <nfsv4@ietf.org>; Mon, 2 Jan 2017 06:42:33 -0800 (PST)
Received: by mail-lf0-x243.google.com with SMTP id t196so23590800lff.3 for <nfsv4@ietf.org>; Mon, 02 Jan 2017 06:42:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=aWBHaECdRfOpQIWMHhBWnXJfCVQJZP2jXsyE/9AmovM=; b=I2zXJUUM9LZ2tyudmul59WBSX3guJ0SF7T1WPuAnoh55MEL2BmKX4jYdEuy9hkWdzF lU9udSmYwCAspJBEcdbSlYjiaJfTeU5931WhN5cudVqqmfK9jqk5xtAFfMa5Fyq1JoNQ RN/M0Leknx5aPVgwIWMyUX8czDZzbB5wm9JARVAW+xy1H3i7VDyvP/ohTy7R8W5DBjnW HCTVBnLQDlcCNvgc5Rlw7vN0ERJCPvhjIAvQTKVr3MLkStu0zXkQSqE6sjPTVrw55m0p QvsmY1sNdGQyekzE3+6pFCK2VdZjDxLkOMJLiimCD7GjCpna6usgrAGAHeaAJ58NJDyC 5Nfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=aWBHaECdRfOpQIWMHhBWnXJfCVQJZP2jXsyE/9AmovM=; b=MuERlJQOEyD5pu99OEWwnYK7MJMWSJLz/2JCWYF2ntYiLumHelQVxNY/hmJeYK9X+e c1dXlP4pPAky/2OYy8+a5g/9Xtft5Gjkz6aTL/wG8/9sXj/ArPYSJ65YSHT+jQk1IuvH WAiQauO5ASPwhVqzATDbsbSKk/fK28lbn+0AG6h4nYeVzo3V1O1BP81o8xDKMx+RoBM/ ETY6hxEl5/M8r3v90A7H2Sq+D4MVzePLX4NrJVwtkVz/wpwkEEtOLJi1IaiSfjp3NqV6 0Nff4WiVp18fQRtjbXaSBwpT3bMo7kZqqEJT6r/ReCkGRstcs3vqSNBwOtNjRrwFWNXQ ywuA==
X-Gm-Message-State: AIkVDXJDxycND8EsX/3R8KcyNxF0BHCD3cNH2wkN8edFTsxdNhf2lzuolUYTqKqg2pkxzA==
X-Received: by 10.25.72.74 with SMTP id v71mr22142259lfa.130.1483368151392; Mon, 02 Jan 2017 06:42:31 -0800 (PST)
Received: from [10.0.1.13] (9.42.202.84.customer.cdi.no. [84.202.42.9]) by smtp.gmail.com with ESMTPSA id e23sm9408194lji.29.2017.01.02.06.42.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jan 2017 06:42:30 -0800 (PST)
From: Trond Myklebust <trondmy@gmail.com>
Message-Id: <CEE069D8-ECE9-4655-8B22-C7B4A8CE3643@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_5BD34ACF-2C67-478C-8B3D-886BA0B9E94C"
Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\))
Date: Mon, 02 Jan 2017 15:42:28 +0100
In-Reply-To: <CADaq8jeAPSFG2zsXvD9FSMg7WOdN1dJNudazTAJGGYwqRHRbhg@mail.gmail.com>
To: Dave Noveck <davenoveck@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> <CADaq8jeAPSFG2zsXvD9FSMg7WOdN1dJNudazTAJGGYwqRHRbhg@mail.gmail.com>
X-Mailer: Apple Mail (2.3259)
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/nr49JmKAFYQED0YQZU9RpCkC0BU>
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:42:35 -0000

> On Jan 2, 2017, at 15:26, David Noveck <davenoveck@gmail.com> wrote:
> 
> > See:
> > https://tools.ietf.org/html/rfc7530#section-10.4.4 <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 <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 <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”.

I fully agree that looks at first glance as if it is a non-normative text. Unfortunately, 15 years of server implementations have taken it as gospel, and hence no client that cares about performance can afford to ignore it.

> 
> On Mon, Jan 2, 2017 at 7:52 AM, Trond Myklebust <trondmy@gmail.com <mailto:trondmy@gmail.com>> wrote:
> 
>> On Jan 2, 2017, at 13:11, David Noveck <davenoveck@gmail.com <mailto: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 <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 <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 <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 <mailto:trondmy@gmail.com>> wrote:
>> 
>> 
>> On 2 January 2017 at 00:19, Rick Macklem <rmacklem@uoguelph.ca <mailto: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 <mailto:nfsv4@ietf.org>
>> https://www.ietf.org/mailman/listinfo/nfsv4 <https://www.ietf.org/mailman/listinfo/nfsv4>
>> 
>> 
> 
>