[nfsv4] Re: OPEN_XOR_DELEGATION when there is existing OPEN stateid

Thomas Haynes <loghyr@gmail.com> Thu, 03 October 2024 17:00 UTC

Return-Path: <loghyr@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 343E8C14F6FC for <nfsv4@ietfa.amsl.com>; Thu, 3 Oct 2024 10:00:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.106
X-Spam-Level:
X-Spam-Status: No, score=-1.106 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] 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 ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id COHJsulqDR2w for <nfsv4@ietfa.amsl.com>; Thu, 3 Oct 2024 10:00:27 -0700 (PDT)
Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8544EC14F5E7 for <nfsv4@ietf.org>; Thu, 3 Oct 2024 10:00:27 -0700 (PDT)
Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-710e01dd554so696091a34.3 for <nfsv4@ietf.org>; Thu, 03 Oct 2024 10:00:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727974826; x=1728579626; darn=ietf.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=LNVlfu8fnAkJ0Q9ZyiJzNiB2XA9PHmStvubNyBw427Y=; b=l5Q+HUwdIigQ9PJ5kE/uQH8GKirWyZANMs5eSXlQ2MXdXwKV84OF9xQ2U6CLHcyFFl yNz5jEMS9v3Ok9vxbNFS4Fv60Ec4+p7fd5TngfstunE+RRAOzEvDxBm2dbij6a9wXZxl 1J1rTOIWz54eu9waRtW3YMPru1oGfkBDIIlEGgpHPJuknVPcM/KgGe7hkQSsWKjw2638 1pA3a5cMpFUHh3GfQyms5zXlTe2q/OFCdAZu7tyFr3sQaPxgR2rHkPzzf/nMq2wfMZCz u2NypwYJGjKo8IoK5hhFkM9f+SNCse0USHUpQ8Pvg1+BOLm9oqfwdJP6pHwUK+x2JHne 9CnQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727974826; x=1728579626; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LNVlfu8fnAkJ0Q9ZyiJzNiB2XA9PHmStvubNyBw427Y=; b=Hi5jT2X3li8DRz5mPSaCeQO31VlPrPml0SEtZzwAnSmccssXYy5sWWbgZnI5zc2P2T t/XV006YKCJ19gplCeiLSKiNWwxf25dalfA1PH0PUgfmERVYTOPWdP5QT1S/9bzOf5PC KLE/VhoYwZzutcdoAs5FJHwiRU8LPEjrM9dycgwrugW/ElHzRxG5HI1AUtEK7dPfDICr tQdIlKVMCAZsbKsLsMX6u8Cb8Wk3PWMtwAx3+nNs/Z2Qe0LVw1ZtKNJ77xKJS3OYQztI vz92/Ccunb+nwrp1puSkITP1Tk+tP/qQXeKL2VW/t41VQQhDfbW6dy4mf0/5L4MrXAA+ 3Hhg==
X-Forwarded-Encrypted: i=1; AJvYcCWJl1q/lnAWjKG4EmYcQCCwSTUX10Krlm9zaO/DE8V8uMI+M84kT9J13LC5rsXl6qcZUSGCBg==@ietf.org
X-Gm-Message-State: AOJu0YzRQsChZM9agoFjqwbKEEpfdAv0ED5nw195RxI5bOCx3MzJVhyh CBgrv8FS8W5dIR+kIQKNkU3dZT4mUZIZSsSKLl1iKjlPH9kYW6F3wLiupg==
X-Google-Smtp-Source: AGHT+IGSRH2pMJoMzYOk7peKl51N164+RfZIykrqm491oZLjOVqqaqITcgfrU79uH3qDA4ChAGj/YA==
X-Received: by 2002:a05:6830:6717:b0:710:f308:62ce with SMTP id 46e09a7af769-7153cda5107mr5796543a34.16.1727974826217; Thu, 03 Oct 2024 10:00:26 -0700 (PDT)
Received: from smtpclient.apple ([2601:647:5b00:bf9:394c:a3a6:8527:fcd8]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e9dcb00f1csm947988a12.25.2024.10.03.10.00.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Oct 2024 10:00:25 -0700 (PDT)
From: Thomas Haynes <loghyr@gmail.com>
Message-Id: <8EDD7747-3C2D-4834-B8B5-87A2BE6F880F@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_8905BBB7-BFA9-4904-94F9-FCFCBFCC570D"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3818.100.11.1.3\))
Date: Thu, 03 Oct 2024 10:00:14 -0700
In-Reply-To: <CAM5tNy7QaXsTm0dWcViSAiGPACg42DXGLgkJ0Y7eeNom72YR6w@mail.gmail.com>
To: Rick Macklem <rick.macklem@gmail.com>
References: <6d1a1371de69d93a682f0c202669c46089033c67.camel@poochiereds.net> <F61478EA-3B05-479D-92FA-486EAC52CF2D@gmail.com> <934dfc20501e03031a010ce52eb97604c2eaa289.camel@poochiereds.net> <D99B6BB8-6676-4F06-A2C5-8D4C47D3E090@gmail.com> <CAM5tNy4K-Kz8maDk9fV+CF0NiPxOxsA325VT2KxOrNMu8GW9Qw@mail.gmail.com> <388f01120834ceb762f6e731885e736639e8f9a6.camel@poochiereds.net> <CAM5tNy7EtV6=jK09zfxihoM=uN9V=k-N+3eMuzCpKu2zbkAqmg@mail.gmail.com> <CAM5tNy7QaXsTm0dWcViSAiGPACg42DXGLgkJ0Y7eeNom72YR6w@mail.gmail.com>
X-Mailer: Apple Mail (2.3818.100.11.1.3)
Message-ID-Hash: 5W2OJ26YVL6ATWXUDD2IZXI7OKKTPNTQ
X-Message-ID-Hash: 5W2OJ26YVL6ATWXUDD2IZXI7OKKTPNTQ
X-MailFrom: loghyr@gmail.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-nfsv4.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: NFSv4 <nfsv4@ietf.org>
X-Mailman-Version: 3.3.9rc5
Precedence: list
Subject: [nfsv4] Re: OPEN_XOR_DELEGATION when there is existing OPEN stateid
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/1hzzkjRGMnxfAVBBRuezOvxY0xY>
List-Archive: <https://mailarchive.ietf.org/arch/browse/nfsv4>
List-Help: <mailto:nfsv4-request@ietf.org?subject=help>
List-Owner: <mailto:nfsv4-owner@ietf.org>
List-Post: <mailto:nfsv4@ietf.org>
List-Subscribe: <mailto:nfsv4-join@ietf.org>
List-Unsubscribe: <mailto:nfsv4-leave@ietf.org>


> On Oct 3, 2024, at 8:12 AM, Rick Macklem <rick.macklem@gmail.com> wrote:
> 
> On Thu, Oct 3, 2024 at 7:32 AM Rick Macklem <rick.macklem@gmail.com <mailto:rick.macklem@gmail.com>> wrote:
>> 
>> On Thu, Oct 3, 2024 at 3:21 AM Jeff Layton <jlayton@poochiereds.net> wrote:
>>> 
>>> On Wed, 2024-10-02 at 17:26 -0700, Rick Macklem wrote:
>>>> On Wed, Oct 2, 2024 at 9:16 AM Thomas Haynes <loghyr@gmail.com> wrote:
>>>>> 
>>>>> 
>>>>> 
>>>>>> On Oct 2, 2024, at 5:51 AM, Jeff Layton <jlayton@poochiereds.net> wrote:
>>>>>> 
>>>>>> On Tue, 2024-10-01 at 22:24 -0700, Thomas Haynes wrote:
>>>>>>> 
>>>>>>>> On Oct 1, 2024, at 6:11 AM, Jeff Layton <jlayton@poochiereds.net> wrote:
>>>>>>>> 
>>>>>>>> Another delstid question. Consider the following situation. All opens
>>>>>>>> have WANT_OPEN_XOR_DELEGATION set:
>>>>>>>> 
>>>>>>>> 1/ Client opens a file r/o. Server doesn't assign a delegation, so an
>>>>>>>> open stateid (with seq=1) is returned.
>>>>>>>> 
>>>>>>>> 2/ Client opens the file again for r/w. Server assigns a delegation and
>>>>>>>> skips updating the OPEN stateid's seqid and sending the result back to
>>>>>>>> the client.
>>>>>>>> 
>>>>>>>> Is that wrong behavior? It seems like that would morph the open stateid
>>>>>>>> for this openowner without updating the client as to the new stateid.
>>>>>>>> The delegation does cover it in that case, but it seems less than
>>>>>>>> optimal if the client ends up returning that delegation later.
>>>>>>>> 
>>>>>>>> If the client already holds an open stateid, should we ignore
>>>>>>>> WANT_OPEN_XOR_DELEGATION?
>>>>>>>> --
>>>>>>>> Jeff Layton <jlayton@poochiereds.net>
>>>>>>> 
>>>>>>> 
>>>>>>> It seems to me we can’t break the upgrade, so we have to honor the WANT_OPEN_XOR_DELEGATION by returning an upgraded open stateid.
>>>>>>> 
>>>>>>> I.e., if the client already has an open stateid and presents an WANT_OPEN_XOR_DELEGATION, then cannot return just a delegation. Either we just upgrade the existing open stateid or we upgrade it and also return the delegation.
>>>>>>> 
>>>>>>> Likewise, if we had already returned a delegation stateid, we should just return a delegation stateid.
>>>>>>> 
>>>>>>> Feel free to argue with me ….
>>>>>> 
>>>>>> No, that makes sense I think.
>>>>>> 
>>>>>> Would it be OK to just ignore WANT_OPEN_XOR_DELEGATION in this case,
>>>>>> and return both an updated open stateid and the delegation stateid?
>>>>>> That's probably the more desirable outcome (regardless of the "XOR" in
>>>>>> the name).
>>>>>> --
>>>>>> Jeff Layton <jlayton@poochiereds.net>
>>>>> 
>>>>> 
>>>>> It is a hint, none of the language states it MUST return one or the other.
>>>> The only bother is that you have to provide a reason for ignoring it.
>>>> Having said that, I doubt clients care what the reason is and I'll
>>>> note that a client is being "dumb" if it uses the
>>>> OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION flag
>>>> in this case.
>>> 
>>> Do we need to provide a reason? I think we can just ignore this flag
>>> and send both stateids in this case. We're not denying the delegation,
>>> so there is no need to send a WND4_* status code.
>> Oops, yes, you are correct. If you are replying with a delegation, you
>> don't need a "why I didn't" flag.  I was thinking that these had to be returned
>> whenever you ignored a WANT flag, but that is not what the RFC says.
>> (I now need to check the FreeBSD server to make sure I got that correct
>> when I implemented it.)
>> 
>> However, for a typical XOR case (where the client does not have an Open
>> already) and choosing to not issue the delegation...
>> --> It is not 100% obvious if a WND4_* flag is required in the reply?
>> (I would say it is not required, because the server is satisfying the
>> request, but??)
> Hmm. Here's what RFC8881 says:
> 
>   If the server supports the new _WANT_ flags and the client sends one
>   or more of the new flags, then in the event the server does not
>   return a delegation, it MUST return a delegation type of
>   OPEN_DELEGATE_NONE_EXT.  The field ond_why in the reply indicates why
>   no delegation was returned and will be one of:
> 
> It sounds like it is clear, in that a WND4_* reply flag is needed if an Open
> with OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION does not
> get a delegation in the reply.
> 
> This brings me to something else that is not explicit in the draft...
> --> OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION only seems
>      meaningful when it is combined with one of the other
>      OPEN_SHARE_ACCESS_WANT_xxx flags.
> Is this correct? Should this be explicit in the draft?

I was going to say yes, but now I believe not after reading RFC8881:

   If (share_access & OPEN4_SHARE_ACCESS_WANT_DELEG_MASK) is not zero,
   then the client will have specified one and only one of:
           
   OPEN4_SHARE_ACCESS_WANT_READ_DELEG
           
   OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG
   
   OPEN4_SHARE_ACCESS_WANT_ANY_DELEG
           
   OPEN4_SHARE_ACCESS_WANT_NO_DELEG
            
   OPEN4_SHARE_ACCESS_WANT_CANCEL  
     
   Otherwise, the client is neither indicating a desire nor a non-desire
   for a delegation, and the server MAY or MAY not return a delegation
   in the OPEN response.

I.e., if I set only OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION, I am saying that I don’t care if you assign me a delegation, but if you do, only assign me one of a delegation or open stateid.

Thoughts?



> 
> rick
> 
>> 
>> rick
>> 
>>> 
>>> --
>>> Jeff Layton <jlayton@poochiereds.net <mailto:jlayton@poochiereds.net>>