All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "ajmitchell@redhat.com" <ajmitchell@redhat.com>,
	"SteveD@RedHat.com" <SteveD@RedHat.com>,
	"chuck.lever@oracle.com" <chuck.lever@oracle.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 0/3] Enable the setting of a kernel module parameter from nfs.conf
Date: Sat, 17 Apr 2021 18:09:11 +0000	[thread overview]
Message-ID: <178b7ac5716b4e384233655eb7251d009faa63cb.camel@hammerspace.com> (raw)
In-Reply-To: <a5b134df-1e62-b877-3eeb-79ab008df636@RedHat.com>

On Sat, 2021-04-17 at 12:33 -0400, Steve Dickson wrote:
> Hey!
> 
> On 4/15/21 8:40 PM, Trond Myklebust wrote:
> > Here is a skeleton example:
> > 
> > [root@leira rules.d]# cat /etc/udev/rules.d/50-nfs4.rules 
> > ACTION=="add" KERNEL=="nfs_client" ATTR{identifier}=="(null)"
> > PROGRAM="/usr/sbin/nfs4_uuid" ATTR{identifier}="%c"
> > 
> > [root@leira rules.d]# cat /usr/sbin/nfs4_uuid 
> > #!/bin/bash
> > #
> > if [ ! -f /etc/nfs4_uuid ]
> > then
> >         uuid="$(uuidgen -r)"
> >         echo -n ${uuid} > /etc/nfs4_uuid
> > else
> >         uuid="$(cat /etc/nfs4_uuid)"
> > fi
> > echo ${uuid}
> > 
> > 
> > Obviously, the /usr/sbin/nfs4_uuid would need to be fleshed out a
> > little more to ensure that the file /etc/nfs4_uuid actually
> > contains a
> > uuid in the right format, but you get the gist...
> > 
> > With the above additions, I end up with a repeatable
> > 
> > [root@leira rules.d]# modprobe nfs4
> > [root@leira rules.d]# cat /sys/fs/nfs/net/nfs_client/identifier 
> > 7f9f211b-0253-4ef8-a970-b1b0f600af02
> > [root@leira rules.d]# cat /etc/nfs4_uuid 
> > 7f9f211b-0253-4ef8-a970-b1b0f600af02
> 
> I see that this example does populate nfs_client/identifier and
> I'm sure we could beef up the mechanism but the may question
> is this.... 
> 
> How does populating nfs_client/identifier via udev
> actually setting the nfs4_unique_id parameter which is used to set
> the unique id? I look and i've must have missed it...
> 
> If the answer is we need to change the client to look a
> the nfs_client/identifier... then we should get rid of the
> nfs4_unique_id param all together... 
> 

Commit 39d43d164127 ("NFSv4: Use the net namespace uniquifier if it is
set") should default to using the nfs_client identifier if it is set.
Otherwise it falls back to using the nfs4_unique_id. So kernels >= 5.10
are ready to use this udev-based mechanism.

The reason why I added udev support is, as I said, because we need
something that works correctly inside containers. Unfortunately, module
parameters are system-wide, so the older mechanism works just fine
right up to the moment where you fire up 'docker', 'kubernetes' or
'podman' (which is an increasingly important use case for NFS).

We do need something a little more sophisticated than the naive script
that I provided. As I said, that was intended as a skeleton example
just to demonstrate the basic mechanism and how to configure udev. It
would be very good to have something similar to what I showed there be
installed by default when you install nfs-utils.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



  reply	other threads:[~2021-04-17 18:11 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14 18:10 [PATCH 0/3] Enable the setting of a kernel module parameter from nfs.conf Steve Dickson
2021-04-14 18:10 ` [PATCH 1/3] nfs-utils: Enable the retrieval of raw config settings without expansion Steve Dickson
2021-05-06 17:29   ` Steve Dickson
2021-04-14 18:10 ` [PATCH 2/3] nfs-utils: Add support for further ${variable} expansions in nfs.conf Steve Dickson
2021-04-14 18:10 ` [PATCH 3/3] nfs-utils: Update nfs4_unique_id module parameter from the nfs.conf value Steve Dickson
2021-04-14 23:26 ` [PATCH 0/3] Enable the setting of a kernel module parameter from nfs.conf Chuck Lever III
2021-04-15 15:33   ` Steve Dickson
2021-04-15 16:37     ` Chuck Lever III
2021-04-15 23:30       ` Trond Myklebust
2021-04-16  0:40         ` Trond Myklebust
2021-04-17 16:33           ` Steve Dickson
2021-04-17 18:09             ` Trond Myklebust [this message]
2021-04-17 16:18       ` Steve Dickson
2021-04-17 16:36         ` Chuck Lever III
2021-04-17 17:50           ` Steve Dickson
2021-04-18 16:51             ` Chuck Lever III
2021-04-20 13:11               ` Steve Dickson
2021-04-20 14:09                 ` Chuck Lever III
2021-04-20 14:31                   ` Trond Myklebust
2021-04-20 17:18                     ` J. Bruce Fields
2021-04-20 17:28                       ` Trond Myklebust
2021-04-20 17:40                         ` bfields
2021-04-20 17:53                           ` Trond Myklebust
2021-04-20 18:16                             ` bfields
2021-04-20 19:30                               ` Steve Dickson
2021-04-20 18:47                     ` Steve Dickson
2021-04-20 18:26                   ` Steve Dickson
2021-05-13  0:29     ` NeilBrown
2021-05-18 12:38       ` Steve Dickson
2021-05-21  2:39         ` NeilBrown

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=178b7ac5716b4e384233655eb7251d009faa63cb.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=SteveD@RedHat.com \
    --cc=ajmitchell@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.