linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Olga Kornievskaia <olga.kornievskaia@gmail.com>
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <anna.schumaker@netapp.com>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/1] NFSv4.0 encode nconnect-enabled client into clientid
Date: Fri, 31 Jan 2020 13:34:32 -0500	[thread overview]
Message-ID: <E45EBB55-7669-4E1E-9F3F-E57BFAB2B7D7@oracle.com> (raw)
In-Reply-To: <CAN-5tyG-Mjk1pvba-9b38Nfp_jA-CUaobtLtPj1UfXyRoj-wxA@mail.gmail.com>



> On Jan 31, 2020, at 12:46 PM, Olga Kornievskaia <olga.kornievskaia@gmail.com> wrote:
> 
> Hi Chuck,
> 
> Thanks for the discussion!
> 
> On Fri, Jan 31, 2020 at 12:10 PM Chuck Lever <chuck.lever@oracle.com> wrote:
>> 
>> Hi Olga-
>> 
>>> On Jan 31, 2020, at 11:57 AM, Olga Kornievskaia <olga.kornievskaia@gmail.com> wrote:
>>> 
>>> From: Olga Kornievskaia <kolga@netapp.com>
>>> 
>>> It helps some servers to be able to identify if the incoming client is
>>> doing nconnect mount or not. While creating the unique client id for
>>> the SETCLIENTID operation add nconnect=X to it.
>> 
>> This makes me itch uncomfortably.
> 
> I was asked...
> 
>> The long-form client ID string is not supposed to be used to communicate
>> client implementation details. In fact, this string is supposed to be
>> opaque to the server -- it can only compare these strings for equality.
> 
> Indeed, to servers it should only be using it for equality no argument
> there but I don't think they are prohibited from deriving info from it
> but shouldn't complain if something changed.
> 
> My reasoning was that we are currently already putting some
> descriptive stuff into the clientid string. We specify what version
> this client is. So why not add something that speaks about its
> nconnect ability?

RFC 7350 Section 9.1.1 discusses what belongs in the client ID string.

- Does adding nconnect help distinguish this client from others?
I think that it adds no new value there.

- How do you guarantee that this client presents the same nconnect
setting after every reboot? If the nconnect setting varies for different
mount points, it's possible that the cl_nconnect value can be different
depending on the order the client performs the mounts.

In fact I don't see how the client is constrained to present the same
nconnect setting even during the same reboot, for similar reasons.

That will break open/lock state reclaim, iiuc. And it will be subtle,
silent, non-deterministic breakage.


>> IMO you would also need to write something akin to a standard that describes
>> this convention so that servers can depend on the form of the string.
>> 
>> How would a server use this information?
> 
> The server is interested in identifying whether or not client is doing
> nconnect or not in order to decide whether or not to apply extra
> locking for a given client mount in order to provide best performance.
> In 4.1 spec, we clearly define how to bind connections to
> session/clientid so server can use that information but 4.0 is lacking
> that and a server is left to just deal with existence of multiple
> connection (trunking) at any give time.

You can't insist that clients use NFSv4.1 in those cases?

Seems like this is proposing that the Linux NFS client should be changed
to fix a server implementation issue for a protocol that already has been
fixed in newer versions.


>>> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
>>> ---
>>> fs/nfs/nfs4proc.c | 20 +++++++++++---------
>>> 1 file changed, 11 insertions(+), 9 deletions(-)
>>> 
>>> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
>>> index 402410c..a90ea28 100644
>>> --- a/fs/nfs/nfs4proc.c
>>> +++ b/fs/nfs/nfs4proc.c
>>> @@ -5950,7 +5950,7 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,
>>>              return 0;
>>> 
>>>      rcu_read_lock();
>>> -     len = 14 +
>>> +     len = 14 + 12 +
>>>              strlen(clp->cl_rpcclient->cl_nodename) +
>>>              1 +
>>>              strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR)) +
>>> @@ -5972,13 +5972,15 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,
>>> 
>>>      rcu_read_lock();
>>>      if (nfs4_client_id_uniquifier[0] != '\0')
>>> -             scnprintf(str, len, "Linux NFSv4.0 %s/%s/%s",
>>> +             scnprintf(str, len, "Linux NFSv4.0 nconnect=%d %s/%s/%s",
>>> +                       clp->cl_nconnect,
>>>                        clp->cl_rpcclient->cl_nodename,
>>>                        nfs4_client_id_uniquifier,
>>>                        rpc_peeraddr2str(clp->cl_rpcclient,
>>>                                         RPC_DISPLAY_ADDR));
>>>      else
>>> -             scnprintf(str, len, "Linux NFSv4.0 %s/%s",
>>> +             scnprintf(str, len, "Linux NFSv4.0 nconnect=%d %s/%s",
>>> +                       clp->cl_nconnect,
>>>                        clp->cl_rpcclient->cl_nodename,
>>>                        rpc_peeraddr2str(clp->cl_rpcclient,
>>>                                         RPC_DISPLAY_ADDR));
>>> @@ -5994,7 +5996,7 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,
>>>      size_t len;
>>>      char *str;
>>> 
>>> -     len = 10 + 10 + 1 + 10 + 1 +
>>> +     len = 10 + 10 + 1 + 10 + 1 + 12 +
>>>              strlen(nfs4_client_id_uniquifier) + 1 +
>>>              strlen(clp->cl_rpcclient->cl_nodename) + 1;
>>> 
>>> @@ -6010,9 +6012,9 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,
>>>      if (!str)
>>>              return -ENOMEM;
>>> 
>>> -     scnprintf(str, len, "Linux NFSv%u.%u %s/%s",
>>> +     scnprintf(str, len, "Linux NFSv%u.%u nconnect=%d %s/%s",
>>>                      clp->rpc_ops->version, clp->cl_minorversion,
>>> -                     nfs4_client_id_uniquifier,
>>> +                     clp->cl_nconnect, nfs4_client_id_uniquifier,
>>>                      clp->cl_rpcclient->cl_nodename);
>> 
>> Doesn't this also change the client ID string used for EXCHANGE_ID ?
> 
> I didn't think it would hurt there. But honestly, I just didn't know
> which of the 3 functions that we have to create clientid were used for
> what protocols so I added nconnect to all.

non_uniform is for NFSv4.0 only. uniform can be used by any minor version.


>>>      clp->cl_owner_id = str;
>>>      return 0;
>>> @@ -6030,7 +6032,7 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,
>>>      if (nfs4_client_id_uniquifier[0] != '\0')
>>>              return nfs4_init_uniquifier_client_string(clp);
>>> 
>>> -     len = 10 + 10 + 1 + 10 + 1 +
>>> +     len = 10 + 10 + 1 + 10 + 1 + 12 +
>>>              strlen(clp->cl_rpcclient->cl_nodename) + 1;
>>> 
>>>      if (len > NFS4_OPAQUE_LIMIT + 1)
>>> @@ -6045,9 +6047,9 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,
>>>      if (!str)
>>>              return -ENOMEM;
>>> 
>>> -     scnprintf(str, len, "Linux NFSv%u.%u %s",
>>> +     scnprintf(str, len, "Linux NFSv%u.%u nconnect=%d %s",
>>>                      clp->rpc_ops->version, clp->cl_minorversion,
>>> -                     clp->cl_rpcclient->cl_nodename);
>>> +                     clp->cl_nconnect, clp->cl_rpcclient->cl_nodename);
>>>      clp->cl_owner_id = str;
>>>      return 0;
>>> }
>>> --
>>> 1.8.3.1
>>> 
>> 
>> --
>> Chuck Lever

--
Chuck Lever




  reply	other threads:[~2020-01-31 18:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-31 16:57 [PATCH 1/1] NFSv4.0 encode nconnect-enabled client into clientid Olga Kornievskaia
2020-01-31 17:09 ` Chuck Lever
2020-01-31 17:46   ` Olga Kornievskaia
2020-01-31 18:34     ` Chuck Lever [this message]
2020-01-31 18:55       ` Olga Kornievskaia
2020-01-31 19:09         ` Chuck Lever
2020-01-31 19:46           ` Olga Kornievskaia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E45EBB55-7669-4E1E-9F3F-E57BFAB2B7D7@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=olga.kornievskaia@gmail.com \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).