Skip to contentSkip to conversation

nfsdctl: add a new nfsdctl tool to nfs-utils

PATCH In review Jeff Layton 3 participants 16 messages Jul 22, 2024 – Oct 17, 2024

Subsystems (2)
lore
Share & tools
lore

Jeff Layton

author maintainer
#0 lore raw

v6 cover nfsdctl: add a new nfsdctl tool to nfs-utils

Hi Steve,

Here's an squashed version of the nfsdctl patches, that represents the latest changes. Let me know if you run into any other problems, and thanks for helping to test this!

---
Changes in v6:
- make the default number of threads 16 in autostart
- doc updates

Changes in v5:
- add support for pool-mode setting
- fix up the handling of nfsd_netlink.h in autoconf
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- add ability to specify an array of pool thread counts in nfs.conf
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- split nfsdctl.h so we can include the UAPI header as-is
- squash the patches together that added Lorenzo's version and convert it to the new interface
- adapt to latest version of netlink interface changes
+ have THREADS_SET/GET report an array of thread counts (one per pool)
+ pass scope in as a string to THREADS_SET instead of using unshare() trick

Changes in v2:
- Adapt to latest kernel netlink interface changes (in particular, send the leastime and gracetime when they are set in the config).
- More help text for different subcommands
- New nfsdctl(8) manpage
- Patch to make systemd preferentially use nfsdctl instead of rpc.nfsd
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Jeff Layton (3):
nfsdctl: add the nfsdctl utility to nfs-utils
nfsdctl: asciidoc source for the manpage
systemd: use nfsdctl to start and stop the nfs server

 configure.ac                 |   19 +
 systemd/nfs-server.service   |    4 +-
 utils/Makefile.am            |    4 +
 utils/nfsdctl/Makefile.am    |   13 +
 utils/nfsdctl/nfsd_netlink.h |   96 +++
 utils/nfsdctl/nfsdctl.8      |  304 ++++++++
 utils/nfsdctl/nfsdctl.adoc   |  158 +++++
 utils/nfsdctl/nfsdctl.c      | 1570 ++++++++++++++++++++++++++++++++++++++++++
 utils/nfsdctl/nfsdctl.h      |   93 +++
 9 files changed, 2259 insertions(+), 2 deletions(-)

---
base-commit: b76dbaa48f7c239accb0c2d1e1d51ddd73f4d6be
change-id: 20240412-nfsdctl-fa8bd8430cfd

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
author maintainer
#1 lore raw

PATCH v6 1/3 nfsdctl: add the nfsdctl utility to nfs-utils

This tool is based on Lorenzo's original nfsdctl tool [1]. His original tool used getopt_long to indicate the command, but that's somewhat limiting. This converts it to a subcommand-based interface, where each subcommand can take its own options, in the spirit of commands like nmcli or virsh.

There are currently 6 different subcommands:

pool-mode get/set current pool mode setting
listener get/set listener info
version get/set supported NFS versions
threads get/set nfsd thread settings
status get current RPC processing info
autostart start server with settings from /etc/nfs.conf

Each can take different options, and we can expand this interface later with more commands as necessary.

This is based on Lorenzo's original userland tool:

https://github.com/LorenzoBianconi/nfsdctl

---
 configure.ac                 |   19 +
 utils/Makefile.am            |    4 +
 utils/nfsdctl/Makefile.am    |   13 +
 utils/nfsdctl/nfsd_netlink.h |   96 +++
 utils/nfsdctl/nfsdctl.8      |  304 ++++++++
 utils/nfsdctl/nfsdctl.c      | 1570 ++++++++++++++++++++++++++++++++++++++++++
 utils/nfsdctl/nfsdctl.h      |   93 +++
 7 files changed, 2099 insertions(+)
configure.ac +19 -0
index 58d1728c5bc6..1aebc3a767a7 100644
@@ -252,6 +252,24 @@ AC_ARG_ENABLE(nfsdcltrack,
 	enable_nfsdcltrack=$enableval,
 	enable_nfsdcltrack="yes")
 
+AC_ARG_ENABLE(nfsdctl,
+	[AS_HELP_STRING([--disable-nfsdctl],[disable nfsdctl program for controlling nfsd@<:@default=no@:>@])],
+	enable_nfsdctl=$enableval,
+	enable_nfsdctl="yes")
+	AM_CONDITIONAL(CONFIG_NFSDCTL, [test "$enable_nfsdctl" = "yes" ])
+	if test "$enable_nfsdctl" = yes; then
+		PKG_CHECK_MODULES(LIBNL3, libnl-3.0 >= 3.1)
+		PKG_CHECK_MODULES(LIBNLGENL3, libnl-genl-3.0 >= 3.1)
+		PKG_CHECK_MODULES(LIBREADLINE, readline)
+		AC_CHECK_HEADERS(linux/nfsd_netlink.h)
+
+		# ensure we have the pool-mode commands
+		AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <linux/nfsd_netlink.h>]],
+				                   [[int foo = NFSD_CMD_POOL_MODE_GET;]])],
+				   [AC_DEFINE([USE_SYSTEM_NFSD_NETLINK_H], 1,
+					      ["Use system's linux/nfsd_netlink.h"])])
+	fi
+
 AC_ARG_ENABLE(nfsv4server,
 	[AS_HELP_STRING([--enable-nfsv4server],[enable support for NFSv4 only server  @<:@default=no@:>@])],
 	enable_nfsv4server=$enableval,
@@ -739,6 +757,7 @@ AC_CONFIG_FILES([
 	utils/mountd/Makefile
 	utils/exportd/Makefile
 	utils/nfsd/Makefile
+	utils/nfsdctl/Makefile
 	utils/nfsref/Makefile
 	utils/nfsstat/Makefile
 	utils/nfsidmap/Makefile
utils/Makefile.am +4 -0
index ab584190f17e..e5cb81e796bd 100644
@@ -35,6 +35,10 @@ if CONFIG_JUNCTION
 OPTDIRS += nfsref
 endif
 
+if CONFIG_NFSDCTL
+OPTDIRS += nfsdctl
+endif
+
 SUBDIRS = \
 	exportfs \
 	mountd \
utils/nfsdctl/Makefile.am new file +13 -0
new file mode 100644
index 000000000000..89c7ecd6f30b
@@ -0,0 +1,13 @@
+## Process this file with automake to produce Makefile.in
+
+man8_MANS       = nfsdctl.8
+EXTRA_DIST      = $(man8_MANS)
+
+sbin_PROGRAMS	= nfsdctl
+
+noinst_HEADERS = nfsdctl.h
+nfsdctl_SOURCES = nfsdctl.c
+nfsdctl_CFLAGS = $(LIBNL3_CFLAGS) $(LIBNLGENL3_CFLAGS) $(LIBREADLINE_CFLAGS)
+nfsdctl_LDADD = ../../support/nfs/libnfs.la $(LIBNL3_LIBS) $(LIBNLGENL3_LIBS) $(LIBREADLINE_LIBS)
+
+MAINTAINERCLEANFILES = Makefile.in
utils/nfsdctl/nfsd_netlink.h new file +96 -0

96 lines not on this page · raw message

utils/nfsdctl/nfsdctl.8 new file +304 -0

305 lines not on this page · raw message

utils/nfsdctl/nfsdctl.c new file +1570 -0

1,570 lines not on this page · raw message

utils/nfsdctl/nfsdctl.h new file +93 -0

93 lines not on this page · raw message

Signature · 1 line
2.45.2
author maintainer
#2 lore raw

PATCH v6 2/3 nfsdctl: asciidoc source for the manpage

In reply to Jeff Layton

Convert to manpage with:

asciidoctor -b manpage nfsdctl.adoc

---
 utils/nfsdctl/nfsdctl.adoc | 158 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 158 insertions(+)
utils/nfsdctl/nfsdctl.adoc new file +158 -0
new file mode 100644
index 000000000000..7119b44db6d2
@@ -0,0 +1,158 @@
+// Convert to manpage via: asciidoctor -b manpage nfsdctl.adoc
+= nfsdctl(8)
+Jeff Layton
+:doctype: manpage
+
+== NAME
+
+nfsdctl - control program for the Linux kernel NFS server
+
+== SYNOPSIS
+
+*nfsdctl* [ _OPTION_ ] COMMAND ...
+
+== DESCRIPTION
+
+nfsdctl is a control and query program for the in-kernel NFS server. There are several
+subcommands (documented below) that allow the admin to configure or query different
+aspects of the NFS server.
+
+To get information about different subcommand usage, pass the subcommand the
+--help parameter. For example:
+
+    nfsdctl listener --help
+
+== OPTIONS
+
+*-d, --debug*::
+  Enable debug logging
+
+*-h, --help*::
+  Print program help text
+
+*-V, --version*::
+  Print program version
+
+== SUBCOMMANDS
+
+Each subcommand can also accept its own set of options and arguments. The
+--help option is standard for all subcommands:
+
+*autostart*::
+  Start the server using the settings in the [nfsd] section of /etc/nfs.conf.
+  This subcommand takes no arguments. Note that if a "threads=" value is not set in
+  nfs.conf, 16 server threads will be brought online.
+
+*listener*::
+
+  Get/set the listening sockets for the server. Run this without arguments to
+  get a list of the sockets on which the server is currently listening. To add
+  or remove sockets, pass it whitespace-separated strings in the format:
+
+    { +|- }{ protocol }:{ address }:{ port }
+
+  The fields are:
+
+    + to add a listener, - to remove one
+    protocol: protocol name (e.g. tcp, udp, rdma)
+    address: hostname or address
+    port: port number or service name
+
+  All fields are required, except for the address. If address is an empty string,
+  then the listeners will be opened for INADDR_ANY and IN6ADDR_ANY_INIT for ipv6
+  (if enabled). The address can be either a hostname or an IP address. IPv4
+  addresses must be in dotted-quad form. IPv6 addresses should be in standard
+  colon separated form, and must be enclosed in square brackets.
+
+*status*::
+
+  Get information about RPCs currently executing in the server. This subcommand
+  takes no arguments.
+
+*threads*::
+
+  Get/set the number of running nfsd threads in each pool. Pass a list of
+  integers to change the currently active number of threads. Passing it a
+  value of 0 will shut down the NFS server. Run this without arguments to
+  get the current number of running threads in each pool.
+
+*version*::
+
+  Get/set the enabled NFS versions for the server. Run without arguments to
+  get a list of supported versions and whether they are currently enabled or
+  disabled. To enable or disable a version, pass it a string in the format:
+
+        { +|- }{ MAJOR }{.{ MINOR }}
+
+  The fields are:
+
+    + to enable a version, - to disable
+    MAJOR: the major version integer value
+    MINOR: the minor version integet value
+
+  The minorversion field is optional. If not given, it will disable or enable
+  all minorversions for that major version.
+
+*pool-mode*::
+
+  Get/set the host's pool mode. This will cause the server to start threads
+  that are pinned to either the CPU or the NUMA node. This can only be set
+  when there are no nfsd threads running.
+
+  The available options are:
+    global:  single large pool
+    percpu:  pool per CPU
+    pernode: pool per NUMA node
+    auto:    choose a mode based on host configuration
+
+== EXAMPLES
+
+Start the server with the settings in nfs.conf:
+
+  nfsdctl autostart
+
+Get a list of current listening sockets:
+
+  nfsdctl listener
+
+Show the supported and enabled NFS versions:
+
+  nfsdctl version
+
+Add TCP listener on all addresses (both v4 and v6), port 2049:
+
+  nfsdctl listener +tcp::2049
+
+Add RDMA listener on 1.2.3.4 port 20049:
+
+  nfsdctl listener +rdma:1.2.3.4:20049
+
+Add same listener on IPv6 address f00::ba4 port 20050:
+
+  nfsdctl listener +rdma:[f00::ba4]:20050
+
+Enable NFS version 3, disable v4.0:
+
+  nfsdctl version +3 -4.0
+
+Change the number of running threads in first pool to 256:
+
+  nfsdctl threads 256
+
+Set the pool-mode to "pernode":
+
+  nfsctl pool-mode pernode
+
+== NOTES
+
+nfsdctl is intended to supersede rpc.nfsd(8), which controls the nfs server
+using the files under /proc/fs/nfsd. nfsdctl instead uses a netlink(7)
+interface to achieve the same goals.
+
+Most of the commands that query the NFS server can be run as an unprivileged
+user, but configuring the server typically requires an account with elevated
+privileges.
+
+== SEE ALSO
+
+nfs.conf(5), rpc.nfsd(8), rpc.mountd(8), exports(5), exportfs(8), nfs.conf(5), rpc.rquotad(8),  nfsstat(8), netconfig(5)
Signature · 1 line
2.45.2
author maintainer
#3 lore raw

PATCH v6 3/3 systemd: use nfsdctl to start and stop the nfs server

In reply to Jeff Layton

Attempt to use nfsdctl to start and stop the nfs-server. If that fails for any reason, use rpc.nfsd to do it instead.

---
 systemd/nfs-server.service | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
systemd/nfs-server.service +2 -2
index ac17d5286d3b..8793856aa707 100644
@@ -23,8 +23,8 @@ After=rpc-gssd.service gssproxy.service rpc-svcgssd.service
 Type=oneshot
 RemainAfterExit=yes
 ExecStartPre=-/usr/sbin/exportfs -r
-ExecStart=/usr/sbin/rpc.nfsd
-ExecStop=/usr/sbin/rpc.nfsd 0
+ExecStart=/bin/sh -c '/usr/sbin/nfsdctl autostart || /usr/sbin/rpc.nfsd'
+ExecStop=/bin/sh -c '/usr/sbin/nfsdctl threads 0 || /usr/sbin/rpc.nfsd 0'
 ExecStopPost=/usr/sbin/exportfs -au
 ExecStopPost=/usr/sbin/exportfs -f
 
Signature · 1 line
2.45.2
#4 lore raw
In reply to Jeff Layton

Hey!

Quoted 53 lines · Jeff Layton

Hi Steve,

Here's an squashed version of the nfsdctl patches, that represents the latest changes. Let me know if you run into any other problems, and thanks for helping to test this!

---
Changes in v6:
- make the default number of threads 16 in autostart
- doc updates

Changes in v5:
- add support for pool-mode setting
- fix up the handling of nfsd_netlink.h in autoconf
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- add ability to specify an array of pool thread counts in nfs.conf
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- split nfsdctl.h so we can include the UAPI header as-is
- squash the patches together that added Lorenzo's version and convert it to the new interface
- adapt to latest version of netlink interface changes
+ have THREADS_SET/GET report an array of thread counts (one per pool)
+ pass scope in as a string to THREADS_SET instead of using unshare() trick

Changes in v2:
- Adapt to latest kernel netlink interface changes (in particular, send the leastime and gracetime when they are set in the config).
- More help text for different subcommands
- New nfsdctl(8) manpage
- Patch to make systemd preferentially use nfsdctl instead of rpc.nfsd
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Jeff Layton (3):
nfsdctl: add the nfsdctl utility to nfs-utils
nfsdctl: asciidoc source for the manpage
systemd: use nfsdctl to start and stop the nfs server

  configure.ac                 |   19 +
  systemd/nfs-server.service   |    4 +-
  utils/Makefile.am            |    4 +
  utils/nfsdctl/Makefile.am    |   13 +
  utils/nfsdctl/nfsd_netlink.h |   96 +++
  utils/nfsdctl/nfsdctl.8      |  304 ++++++++
  utils/nfsdctl/nfsdctl.adoc   |  158 +++++
  utils/nfsdctl/nfsdctl.c      | 1570 ++++++++++++++++++++++++++++++++++++++++++
  utils/nfsdctl/nfsdctl.h      |   93 +++
  9 files changed, 2259 insertions(+), 2 deletions(-)
Quoted 3 lines

---
base-commit: b76dbaa48f7c239accb0c2d1e1d51ddd73f4d6be
change-id: 20240412-nfsdctl-fa8bd8430cfd

The patches apply very cleaning and thank you for squashing them down... but... bring up the NFS server with 'nfsdctl autostart' v3 is not being registered with rpcbind which means v3 mount will not work.

Just curious are you trying support my idea of deprecating V3 :-) (That's a joke!)

steved.

author maintainer
#5 lore raw
Quoted 75 lines · Steve Dickson

Hey!

Quoted 61 lines · Jeff Layton

Hi Steve,

Here's an squashed version of the nfsdctl patches, that represents the latest changes. Let me know if you run into any other problems, and thanks for helping to test this!

---
Changes in v6:
- make the default number of threads 16 in autostart
- doc updates

Changes in v5:
- add support for pool-mode setting
- fix up the handling of nfsd_netlink.h in autoconf
- Link to v4:
https://lore.kernel.org/r/[email protected]

Changes in v4:
- add ability to specify an array of pool thread counts in nfs.conf
- Link to v3:
https://lore.kernel.org/r/[email protected]

Changes in v3:
- split nfsdctl.h so we can include the UAPI header as-is
- squash the patches together that added Lorenzo's version and convert
   it to the new interface
- adapt to latest version of netlink interface changes
   + have THREADS_SET/GET report an array of thread counts (one per pool)
   + pass scope in as a string to THREADS_SET instead of using unshare() trick

Changes in v2:
- Adapt to latest kernel netlink interface changes (in particular, send
   the leastime and gracetime when they are set in the config).
- More help text for different subcommands
- New nfsdctl(8) manpage
- Patch to make systemd preferentially use nfsdctl instead of rpc.nfsd
- Link to v1:
https://lore.kernel.org/r/[email protected]

---
Jeff Layton (3):
       nfsdctl: add the nfsdctl utility to nfs-utils
       nfsdctl: asciidoc source for the manpage
       systemd: use nfsdctl to start and stop the nfs server

  configure.ac                 |   19 +
  systemd/nfs-server.service   |    4 +-
  utils/Makefile.am            |    4 +
  utils/nfsdctl/Makefile.am    |   13 +
  utils/nfsdctl/nfsd_netlink.h |   96 +++
  utils/nfsdctl/nfsdctl.8      |  304 ++++++++
  utils/nfsdctl/nfsdctl.adoc   |  158 +++++
  utils/nfsdctl/nfsdctl.c      | 1570
++++++++++++++++++++++++++++++++++++++++++
  utils/nfsdctl/nfsdctl.h      |   93 +++

Quoted 4 lines
  9 files changed, 2259 insertions(+), 2 deletions(-)

---
base-commit: b76dbaa48f7c239accb0c2d1e1d51ddd73f4d6be
change-id: 20240412-nfsdctl-fa8bd8430cfd

The patches apply very cleaning and thank you for squashing them down... but... bring up the NFS server with 'nfsdctl autostart' v3 is not being registered with rpcbind which means v3 mount will not work.

Quoted 5 lines

Just curious are you trying support my idea of deprecating V3 :-) (That's a joke!)

steved.

You do need a patched kernel for this:

    https://lore.kernel.org/linux-nfs/[email protected]/T/#e675642639c59b1c0070f4b19cd03b89cff7983ba

With a patched kernel, I get this with autostart:

[kdevops@kdevops-nfsd ~]$ rpcinfo -p

   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  42104  status
    100024    1   tcp  40159  status
    100003    3   udp   2049  nfs
    100227    3   udp   2049  nfs_acl
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100227    3   tcp   2049  nfs_acl
    100021    1   udp  46387  nlockmgr
    100021    3   udp  46387  nlockmgr
    100021    4   udp  46387  nlockmgr
    100021    1   tcp  36565  nlockmgr
    100021    3   tcp  36565  nlockmgr
    100021    4   tcp  36565  nlockmgr

Are you seeing different results?

Signature · 1 line
Jeff Layton <[email protected]>
#6 lore raw
Quoted 111 lines · Jeff Layton
Quoted 75 lines · Steve Dickson

Hey!

Quoted 62 lines · Jeff Layton

Hi Steve,

Here's an squashed version of the nfsdctl patches, that represents the latest changes. Let me know if you run into any other problems, and thanks for helping to test this!

---
Changes in v6:
- make the default number of threads 16 in autostart
- doc updates

Changes in v5:
- add support for pool-mode setting
- fix up the handling of nfsd_netlink.h in autoconf
- Link to v4:
https://lore.kernel.org/r/[email protected]

Changes in v4:
- add ability to specify an array of pool thread counts in nfs.conf
- Link to v3:
https://lore.kernel.org/r/[email protected]

Changes in v3:
- split nfsdctl.h so we can include the UAPI header as-is
- squash the patches together that added Lorenzo's version and convert
   it to the new interface
- adapt to latest version of netlink interface changes
   + have THREADS_SET/GET report an array of thread counts (one per
pool)
   + pass scope in as a string to THREADS_SET instead of using
unshare() trick

Changes in v2:
- Adapt to latest kernel netlink interface changes (in particular, send
   the leastime and gracetime when they are set in the config).
- More help text for different subcommands
- New nfsdctl(8) manpage
- Patch to make systemd preferentially use nfsdctl instead of rpc.nfsd
- Link to v1:
https://lore.kernel.org/r/[email protected]

---
Jeff Layton (3):
       nfsdctl: add the nfsdctl utility to nfs-utils
       nfsdctl: asciidoc source for the manpage
       systemd: use nfsdctl to start and stop the nfs server

   configure.ac                 |   19 +
   systemd/nfs-server.service   |    4 +-
   utils/Makefile.am            |    4 +
   utils/nfsdctl/Makefile.am    |   13 +
   utils/nfsdctl/nfsd_netlink.h |   96 +++
   utils/nfsdctl/nfsdctl.8      |  304 ++++++++
   utils/nfsdctl/nfsdctl.adoc   |  158 +++++
   utils/nfsdctl/nfsdctl.c      | 1570
++++++++++++++++++++++++++++++++++++++++++
   utils/nfsdctl/nfsdctl.h      |   93 +++
   9 files changed, 2259 insertions(+), 2 deletions(-)
Quoted 3 lines

---
base-commit: b76dbaa48f7c239accb0c2d1e1d51ddd73f4d6be
change-id: 20240412-nfsdctl-fa8bd8430cfd

The patches apply very cleaning and thank you for squashing them down... but... bring up the NFS server with 'nfsdctl autostart' v3 is not being registered with rpcbind which means v3 mount will not work.

Quoted 5 lines

Just curious are you trying support my idea of deprecating V3 :-) (That's a joke!)

steved.

You do need a patched kernel for this:

     https://lore.kernel.org/linux-nfs/[email protected]/T/#e675642639c59b1c0070f4b19cd03b89cff7983ba

With a patched kernel, I get this with autostart:

[kdevops@kdevops-nfsd ~]$ rpcinfo -p

    program vers proto   port  service
     100000    4   tcp    111  portmapper
     100000    3   tcp    111  portmapper
     100000    2   tcp    111  portmapper
     100000    4   udp    111  portmapper
     100000    3   udp    111  portmapper
     100000    2   udp    111  portmapper
     100024    1   udp  42104  status
     100024    1   tcp  40159  status
     100003    3   udp   2049  nfs
     100227    3   udp   2049  nfs_acl
     100003    3   tcp   2049  nfs
     100003    4   tcp   2049  nfs
     100227    3   tcp   2049  nfs_acl
     100021    1   udp  46387  nlockmgr
     100021    3   udp  46387  nlockmgr
     100021    4   udp  46387  nlockmgr
     100021    1   tcp  36565  nlockmgr
     100021    3   tcp  36565  nlockmgr
     100021    4   tcp  36565  nlockmgr
Quoted 1 line

Are you seeing different results?

Yup
uname -r 6.11.0-0.rc0.20240724git786c8248dbd3.12.fc41.x86_64 (rawhide)

rpcinfo -p

   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100005    1   udp  20048  mountd
    100005    1   tcp  20048  mountd
    100024    1   udp  38596  status
    100024    1   tcp  60257  status
    100005    2   udp  20048  mountd
    100005    2   tcp  20048  mountd
    100005    3   udp  20048  mountd
    100005    3   tcp  20048  mountd
    100021    1   udp  55966  nlockmgr
    100021    3   udp  55966  nlockmgr
    100021    4   udp  55966  nlockmgr
    100021    1   tcp  40995  nlockmgr
    100021    3   tcp  40995  nlockmgr
    100021    4   tcp  40995  nlockmgr
# mount -o v3 fedora:/home/tmp /mnt/tmp
mount.nfs: requested NFS version or transport protocol is not supported for /mnt/tmp

steved.

author maintainer
#7 lore raw
Quoted 113 lines · Steve Dickson
Quoted 111 lines · Jeff Layton
Quoted 75 lines · Steve Dickson

Hey!

Quoted 62 lines · Jeff Layton

Hi Steve,

Here's an squashed version of the nfsdctl patches, that represents the latest changes. Let me know if you run into any other problems, and thanks for helping to test this!

---
Changes in v6:
- make the default number of threads 16 in autostart
- doc updates

Changes in v5:
- add support for pool-mode setting
- fix up the handling of nfsd_netlink.h in autoconf
- Link to v4:
https://lore.kernel.org/r/[email protected]

Changes in v4:
- add ability to specify an array of pool thread counts in nfs.conf
- Link to v3:
https://lore.kernel.org/r/[email protected]

Changes in v3:
- split nfsdctl.h so we can include the UAPI header as-is
- squash the patches together that added Lorenzo's version and convert
   it to the new interface
- adapt to latest version of netlink interface changes
   + have THREADS_SET/GET report an array of thread counts (one per
pool)
   + pass scope in as a string to THREADS_SET instead of using
unshare() trick

Changes in v2:
- Adapt to latest kernel netlink interface changes (in particular, send
   the leastime and gracetime when they are set in the config).
- More help text for different subcommands
- New nfsdctl(8) manpage
- Patch to make systemd preferentially use nfsdctl instead of rpc.nfsd
- Link to v1:
https://lore.kernel.org/r/[email protected]

---
Jeff Layton (3):
       nfsdctl: add the nfsdctl utility to nfs-utils
       nfsdctl: asciidoc source for the manpage
       systemd: use nfsdctl to start and stop the nfs server

   configure.ac                 |   19 +
   systemd/nfs-server.service   |    4 +-
   utils/Makefile.am            |    4 +
   utils/nfsdctl/Makefile.am    |   13 +
   utils/nfsdctl/nfsd_netlink.h |   96 +++
   utils/nfsdctl/nfsdctl.8      |  304 ++++++++
   utils/nfsdctl/nfsdctl.adoc   |  158 +++++
   utils/nfsdctl/nfsdctl.c      | 1570
++++++++++++++++++++++++++++++++++++++++++
   utils/nfsdctl/nfsdctl.h      |   93 +++
   9 files changed, 2259 insertions(+), 2 deletions(-)
Quoted 3 lines

---
base-commit: b76dbaa48f7c239accb0c2d1e1d51ddd73f4d6be
change-id: 20240412-nfsdctl-fa8bd8430cfd

The patches apply very cleaning and thank you for squashing them down... but... bring up the NFS server with 'nfsdctl autostart' v3 is not being registered with rpcbind which means v3 mount will not work.

Quoted 5 lines

Just curious are you trying support my idea of deprecating V3 :-) (That's a joke!)

steved.

You do need a patched kernel for this:

     https://lore.kernel.org/linux-nfs/[email protected]/T/#e675642639c59b1c0070f4b19cd03b89cff7983ba

With a patched kernel, I get this with autostart:

[kdevops@kdevops-nfsd ~]$ rpcinfo -p

    program vers proto   port  service
     100000    4   tcp    111  portmapper
     100000    3   tcp    111  portmapper
     100000    2   tcp    111  portmapper
     100000    4   udp    111  portmapper
     100000    3   udp    111  portmapper
     100000    2   udp    111  portmapper
     100024    1   udp  42104  status
     100024    1   tcp  40159  status
     100003    3   udp   2049  nfs
     100227    3   udp   2049  nfs_acl
     100003    3   tcp   2049  nfs
     100003    4   tcp   2049  nfs
     100227    3   tcp   2049  nfs_acl
     100021    1   udp  46387  nlockmgr
     100021    3   udp  46387  nlockmgr
     100021    4   udp  46387  nlockmgr
     100021    1   tcp  36565  nlockmgr
     100021    3   tcp  36565  nlockmgr
     100021    4   tcp  36565  nlockmgr
Quoted 5 lines
Quoted 1 line

Are you seeing different results?

Yup
uname -r 6.11.0-0.rc0.20240724git786c8248dbd3.12.fc41.x86_64 (rawhide)

Did you patch that kernel by hand then? AFAICT, that git hash doesn't have the necessary fix. I don't think Chuck has sent a PR to Linus for it just yet.

Quoted 27 lines

rpcinfo -p

    program vers proto   port  service
     100000    4   tcp    111  portmapper
     100000    3   tcp    111  portmapper
     100000    2   tcp    111  portmapper
     100000    4   udp    111  portmapper
     100000    3   udp    111  portmapper
     100000    2   udp    111  portmapper
     100005    1   udp  20048  mountd
     100005    1   tcp  20048  mountd
     100024    1   udp  38596  status
     100024    1   tcp  60257  status
     100005    2   udp  20048  mountd
     100005    2   tcp  20048  mountd
     100005    3   udp  20048  mountd
     100005    3   tcp  20048  mountd
     100021    1   udp  55966  nlockmgr
     100021    3   udp  55966  nlockmgr
     100021    4   udp  55966  nlockmgr
     100021    1   tcp  40995  nlockmgr
     100021    3   tcp  40995  nlockmgr
     100021    4   tcp  40995  nlockmgr
# mount -o v3 fedora:/home/tmp /mnt/tmp
mount.nfs: requested NFS version or transport protocol is not supported 
for /mnt/tmp
Signature · 1 line
Jeff Layton <[email protected]>
#8 lore raw
Quoted 115 lines · Jeff Layton
Quoted 114 lines · Steve Dickson
Quoted 112 lines · Jeff Layton
Quoted 75 lines · Steve Dickson

Hey!

Quoted 62 lines · Jeff Layton

Hi Steve,

Here's an squashed version of the nfsdctl patches, that represents the latest changes. Let me know if you run into any other problems, and thanks for helping to test this!

---
Changes in v6:
- make the default number of threads 16 in autostart
- doc updates

Changes in v5:
- add support for pool-mode setting
- fix up the handling of nfsd_netlink.h in autoconf
- Link to v4:
https://lore.kernel.org/r/[email protected]

Changes in v4:
- add ability to specify an array of pool thread counts in nfs.conf
- Link to v3:
https://lore.kernel.org/r/[email protected]

Changes in v3:
- split nfsdctl.h so we can include the UAPI header as-is
- squash the patches together that added Lorenzo's version and convert
   it to the new interface
- adapt to latest version of netlink interface changes
   + have THREADS_SET/GET report an array of thread counts (one per
pool)
   + pass scope in as a string to THREADS_SET instead of using
unshare() trick

Changes in v2:
- Adapt to latest kernel netlink interface changes (in particular, send
   the leastime and gracetime when they are set in the config).
- More help text for different subcommands
- New nfsdctl(8) manpage
- Patch to make systemd preferentially use nfsdctl instead of rpc.nfsd
- Link to v1:
https://lore.kernel.org/r/[email protected]

---
Jeff Layton (3):
       nfsdctl: add the nfsdctl utility to nfs-utils
       nfsdctl: asciidoc source for the manpage
       systemd: use nfsdctl to start and stop the nfs server

    configure.ac                 |   19 +
    systemd/nfs-server.service   |    4 +-
    utils/Makefile.am            |    4 +
    utils/nfsdctl/Makefile.am    |   13 +
    utils/nfsdctl/nfsd_netlink.h |   96 +++
    utils/nfsdctl/nfsdctl.8      |  304 ++++++++
    utils/nfsdctl/nfsdctl.adoc   |  158 +++++
    utils/nfsdctl/nfsdctl.c      | 1570
++++++++++++++++++++++++++++++++++++++++++
    utils/nfsdctl/nfsdctl.h      |   93 +++
    9 files changed, 2259 insertions(+), 2 deletions(-)
Quoted 3 lines

---
base-commit: b76dbaa48f7c239accb0c2d1e1d51ddd73f4d6be
change-id: 20240412-nfsdctl-fa8bd8430cfd

The patches apply very cleaning and thank you for squashing them down... but... bring up the NFS server with 'nfsdctl autostart' v3 is not being registered with rpcbind which means v3 mount will not work.

Quoted 5 lines

Just curious are you trying support my idea of deprecating V3 :-) (That's a joke!)

steved.

You do need a patched kernel for this:

      https://lore.kernel.org/linux-nfs/[email protected]/T/#e675642639c59b1c0070f4b19cd03b89cff7983ba

With a patched kernel, I get this with autostart:

[kdevops@kdevops-nfsd ~]$ rpcinfo -p

     program vers proto   port  service
      100000    4   tcp    111  portmapper
      100000    3   tcp    111  portmapper
      100000    2   tcp    111  portmapper
      100000    4   udp    111  portmapper
      100000    3   udp    111  portmapper
      100000    2   udp    111  portmapper
      100024    1   udp  42104  status
      100024    1   tcp  40159  status
      100003    3   udp   2049  nfs
      100227    3   udp   2049  nfs_acl
      100003    3   tcp   2049  nfs
      100003    4   tcp   2049  nfs
      100227    3   tcp   2049  nfs_acl
      100021    1   udp  46387  nlockmgr
      100021    3   udp  46387  nlockmgr
      100021    4   udp  46387  nlockmgr
      100021    1   tcp  36565  nlockmgr
      100021    3   tcp  36565  nlockmgr
      100021    4   tcp  36565  nlockmgr

Are you seeing different results?

Quoted 8 lines
Quoted 4 lines

Yup
uname -r 6.11.0-0.rc0.20240724git786c8248dbd3.12.fc41.x86_64 (rawhide)

Did you patch that kernel by hand then? AFAICT, that git hash doesn't have the necessary fix. I don't think Chuck has sent a PR to Linus for it just yet.

No I did not... Due to the fact I can not commit theses patches until the kernel patch land into the distros.

steved.

#9 lore raw
In reply to Jeff Layton
Quoted 118 lines · Jeff Layton
Quoted 113 lines · Steve Dickson
Quoted 111 lines · Jeff Layton
Quoted 75 lines · Steve Dickson

Hey!

Quoted 62 lines · Jeff Layton

Hi Steve,

Here's an squashed version of the nfsdctl patches, that represents the latest changes. Let me know if you run into any other problems, and thanks for helping to test this!

---
Changes in v6:
- make the default number of threads 16 in autostart
- doc updates

Changes in v5:
- add support for pool-mode setting
- fix up the handling of nfsd_netlink.h in autoconf
- Link to v4:
https://lore.kernel.org/r/[email protected]

Changes in v4:
- add ability to specify an array of pool thread counts in nfs.conf
- Link to v3:
https://lore.kernel.org/r/[email protected]

Changes in v3:
- split nfsdctl.h so we can include the UAPI header as-is
- squash the patches together that added Lorenzo's version and convert
it to the new interface
- adapt to latest version of netlink interface changes
+ have THREADS_SET/GET report an array of thread counts (one per
pool)
+ pass scope in as a string to THREADS_SET instead of using
unshare() trick

Changes in v2:
- Adapt to latest kernel netlink interface changes (in particular, send
the leastime and gracetime when they are set in the config).
- More help text for different subcommands
- New nfsdctl(8) manpage
- Patch to make systemd preferentially use nfsdctl instead of rpc.nfsd
- Link to v1:
https://lore.kernel.org/r/[email protected]

---
Jeff Layton (3):
nfsdctl: add the nfsdctl utility to nfs-utils
nfsdctl: asciidoc source for the manpage
systemd: use nfsdctl to start and stop the nfs server

  configure.ac                 |   19 +
  systemd/nfs-server.service   |    4 +-
  utils/Makefile.am            |    4 +
  utils/nfsdctl/Makefile.am    |   13 +
  utils/nfsdctl/nfsd_netlink.h |   96 +++
  utils/nfsdctl/nfsdctl.8      |  304 ++++++++
  utils/nfsdctl/nfsdctl.adoc   |  158 +++++
  utils/nfsdctl/nfsdctl.c      | 1570
++++++++++++++++++++++++++++++++++++++++++
  utils/nfsdctl/nfsdctl.h      |   93 +++
  9 files changed, 2259 insertions(+), 2 deletions(-)
Quoted 3 lines

---
base-commit: b76dbaa48f7c239accb0c2d1e1d51ddd73f4d6be
change-id: 20240412-nfsdctl-fa8bd8430cfd

The patches apply very cleaning and thank you for squashing them down... but... bring up the NFS server with 'nfsdctl autostart' v3 is not being registered with rpcbind which means v3 mount will not work.

Quoted 5 lines

Just curious are you trying support my idea of deprecating V3 :-) (That's a joke!)

steved.

You do need a patched kernel for this:

    https://lore.kernel.org/linux-nfs/[email protected]/T/#e675642639c59b1c0070f4b19cd03b89cff7983ba

With a patched kernel, I get this with autostart:

[kdevops@kdevops-nfsd ~]$ rpcinfo -p

   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  42104  status
    100024    1   tcp  40159  status
    100003    3   udp   2049  nfs
    100227    3   udp   2049  nfs_acl
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100227    3   tcp   2049  nfs_acl
    100021    1   udp  46387  nlockmgr
    100021    3   udp  46387  nlockmgr
    100021    4   udp  46387  nlockmgr
    100021    1   tcp  36565  nlockmgr
    100021    3   tcp  36565  nlockmgr
    100021    4   tcp  36565  nlockmgr
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Are you seeing different results?

Yup
uname -r 6.11.0-0.rc0.20240724git786c8248dbd3.12.fc41.x86_64 (rawhide)

Did you patch that kernel by hand then? AFAICT, that git hash doesn't have the necessary fix. I don't think Chuck has sent a PR to Linus for it just yet.

"nfsd: don't set SVC_SOCK_ANONYMOUS when creating nfsd sockets" is queued up for v6.11-rc.

--
Chuck Lever

author maintainer
#10 lore raw
In reply to Jeff Layton
Quoted 53 lines · Jeff Layton

Hi Steve,

Here's an squashed version of the nfsdctl patches, that represents the latest changes. Let me know if you run into any other problems, and thanks for helping to test this!

---
Changes in v6:
- make the default number of threads 16 in autostart
- doc updates

Changes in v5:
- add support for pool-mode setting
- fix up the handling of nfsd_netlink.h in autoconf
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- add ability to specify an array of pool thread counts in nfs.conf
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- split nfsdctl.h so we can include the UAPI header as-is
- squash the patches together that added Lorenzo's version and convert it to the new interface
- adapt to latest version of netlink interface changes
+ have THREADS_SET/GET report an array of thread counts (one per pool)
+ pass scope in as a string to THREADS_SET instead of using unshare() trick

Changes in v2:
- Adapt to latest kernel netlink interface changes (in particular, send the leastime and gracetime when they are set in the config).
- More help text for different subcommands
- New nfsdctl(8) manpage
- Patch to make systemd preferentially use nfsdctl instead of rpc.nfsd
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Jeff Layton (3):
nfsdctl: add the nfsdctl utility to nfs-utils
nfsdctl: asciidoc source for the manpage
systemd: use nfsdctl to start and stop the nfs server

 configure.ac                 |   19 +
 systemd/nfs-server.service   |    4 +-
 utils/Makefile.am            |    4 +
 utils/nfsdctl/Makefile.am    |   13 +
 utils/nfsdctl/nfsd_netlink.h |   96 +++
 utils/nfsdctl/nfsdctl.8      |  304 ++++++++
 utils/nfsdctl/nfsdctl.adoc   |  158 +++++
 utils/nfsdctl/nfsdctl.c      | 1570 ++++++++++++++++++++++++++++++++++++++++++
 utils/nfsdctl/nfsdctl.h      |   93 +++
 9 files changed, 2259 insertions(+), 2 deletions(-)
Quoted 5 lines

---
base-commit: b76dbaa48f7c239accb0c2d1e1d51ddd73f4d6be
change-id: 20240412-nfsdctl-fa8bd8430cfd

Best regards,

Ping?

Signature · 1 line
Jeff Layton <[email protected]>
#11 lore raw
Quoted 58 lines · Jeff Layton
Quoted 57 lines · Jeff Layton

Hi Steve,

Here's an squashed version of the nfsdctl patches, that represents the latest changes. Let me know if you run into any other problems, and thanks for helping to test this!

---
Changes in v6:
- make the default number of threads 16 in autostart
- doc updates

Changes in v5:
- add support for pool-mode setting
- fix up the handling of nfsd_netlink.h in autoconf
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- add ability to specify an array of pool thread counts in nfs.conf
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- split nfsdctl.h so we can include the UAPI header as-is
- squash the patches together that added Lorenzo's version and convert it to the new interface
- adapt to latest version of netlink interface changes
+ have THREADS_SET/GET report an array of thread counts (one per pool)
+ pass scope in as a string to THREADS_SET instead of using unshare() trick

Changes in v2:
- Adapt to latest kernel netlink interface changes (in particular, send the leastime and gracetime when they are set in the config).
- More help text for different subcommands
- New nfsdctl(8) manpage
- Patch to make systemd preferentially use nfsdctl instead of rpc.nfsd
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Jeff Layton (3):
nfsdctl: add the nfsdctl utility to nfs-utils
nfsdctl: asciidoc source for the manpage
systemd: use nfsdctl to start and stop the nfs server

  configure.ac                 |   19 +
  systemd/nfs-server.service   |    4 +-
  utils/Makefile.am            |    4 +
  utils/nfsdctl/Makefile.am    |   13 +
  utils/nfsdctl/nfsd_netlink.h |   96 +++
  utils/nfsdctl/nfsdctl.8      |  304 ++++++++
  utils/nfsdctl/nfsdctl.adoc   |  158 +++++
  utils/nfsdctl/nfsdctl.c      | 1570 ++++++++++++++++++++++++++++++++++++++++++
  utils/nfsdctl/nfsdctl.h      |   93 +++
  9 files changed, 2259 insertions(+), 2 deletions(-)

---
base-commit: b76dbaa48f7c239accb0c2d1e1d51ddd73f4d6be
change-id: 20240412-nfsdctl-fa8bd8430cfd

Quoted 3 lines
Quoted 1 line

Best regards,

Ping?

I'm keeping my eye on it.... I have the bits on
a private branch... I just don't want to break
v3... when the distros get to 6.11... I'll
make it happen

steved.

author maintainer
#12 lore raw
Quoted 60 lines · Steve Dickson
Quoted 58 lines · Jeff Layton
Quoted 57 lines · Jeff Layton

Hi Steve,

Here's an squashed version of the nfsdctl patches, that represents the latest changes. Let me know if you run into any other problems, and thanks for helping to test this!

---
Changes in v6:
- make the default number of threads 16 in autostart
- doc updates

Changes in v5:
- add support for pool-mode setting
- fix up the handling of nfsd_netlink.h in autoconf
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- add ability to specify an array of pool thread counts in nfs.conf
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- split nfsdctl.h so we can include the UAPI header as-is
- squash the patches together that added Lorenzo's version and convert it to the new interface
- adapt to latest version of netlink interface changes
+ have THREADS_SET/GET report an array of thread counts (one per pool)
+ pass scope in as a string to THREADS_SET instead of using unshare() trick

Changes in v2:
- Adapt to latest kernel netlink interface changes (in particular, send the leastime and gracetime when they are set in the config).
- More help text for different subcommands
- New nfsdctl(8) manpage
- Patch to make systemd preferentially use nfsdctl instead of rpc.nfsd
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Jeff Layton (3):
nfsdctl: add the nfsdctl utility to nfs-utils
nfsdctl: asciidoc source for the manpage
systemd: use nfsdctl to start and stop the nfs server

  configure.ac                 |   19 +
  systemd/nfs-server.service   |    4 +-
  utils/Makefile.am            |    4 +
  utils/nfsdctl/Makefile.am    |   13 +
  utils/nfsdctl/nfsd_netlink.h |   96 +++
  utils/nfsdctl/nfsdctl.8      |  304 ++++++++
  utils/nfsdctl/nfsdctl.adoc   |  158 +++++
  utils/nfsdctl/nfsdctl.c      | 1570 ++++++++++++++++++++++++++++++++++++++++++
  utils/nfsdctl/nfsdctl.h      |   93 +++
  9 files changed, 2259 insertions(+), 2 deletions(-)

---
base-commit: b76dbaa48f7c239accb0c2d1e1d51ddd73f4d6be
change-id: 20240412-nfsdctl-fa8bd8430cfd

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Best regards,

Ping?

I'm keeping my eye on it.... I have the bits on
a private branch... I just don't want to break
v3... when the distros get to 6.11... I'll
make it happen

Previously, you said you would merge it once rawhide had a sufficient kernel, which it has had for months. Fedora 40 is now shipping a v6.11 kernel. Can we get this in now?

Thanks,

Signature · 1 line
Jeff Layton <[email protected]>
#13 lore raw
Quoted 70 lines · Jeff Layton
Quoted 60 lines · Steve Dickson
Quoted 58 lines · Jeff Layton
Quoted 57 lines · Jeff Layton

Hi Steve,

Here's an squashed version of the nfsdctl patches, that represents the latest changes. Let me know if you run into any other problems, and thanks for helping to test this!

---
Changes in v6:
- make the default number of threads 16 in autostart
- doc updates

Changes in v5:
- add support for pool-mode setting
- fix up the handling of nfsd_netlink.h in autoconf
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- add ability to specify an array of pool thread counts in nfs.conf
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- split nfsdctl.h so we can include the UAPI header as-is
- squash the patches together that added Lorenzo's version and convert it to the new interface
- adapt to latest version of netlink interface changes
+ have THREADS_SET/GET report an array of thread counts (one per pool)
+ pass scope in as a string to THREADS_SET instead of using unshare() trick

Changes in v2:
- Adapt to latest kernel netlink interface changes (in particular, send the leastime and gracetime when they are set in the config).
- More help text for different subcommands
- New nfsdctl(8) manpage
- Patch to make systemd preferentially use nfsdctl instead of rpc.nfsd
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Jeff Layton (3):
nfsdctl: add the nfsdctl utility to nfs-utils
nfsdctl: asciidoc source for the manpage
systemd: use nfsdctl to start and stop the nfs server

   configure.ac                 |   19 +
   systemd/nfs-server.service   |    4 +-
   utils/Makefile.am            |    4 +
   utils/nfsdctl/Makefile.am    |   13 +
   utils/nfsdctl/nfsd_netlink.h |   96 +++
   utils/nfsdctl/nfsdctl.8      |  304 ++++++++
   utils/nfsdctl/nfsdctl.adoc   |  158 +++++
   utils/nfsdctl/nfsdctl.c      | 1570 ++++++++++++++++++++++++++++++++++++++++++
   utils/nfsdctl/nfsdctl.h      |   93 +++
   9 files changed, 2259 insertions(+), 2 deletions(-)

---
base-commit: b76dbaa48f7c239accb0c2d1e1d51ddd73f4d6be
change-id: 20240412-nfsdctl-fa8bd8430cfd

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Best regards,

Ping?

I'm keeping my eye on it.... I have the bits on
a private branch... I just don't want to break
v3... when the distros get to 6.11... I'll
make it happen

Quoted 3 lines

Previously, you said you would merge it once rawhide had a sufficient kernel, which it has had for months. Fedora 40 is now shipping a v6.11 kernel. Can we get this in now?

Very true... I did notice just f40 got to v6.11... so now I can make the release... just in time for Bakeathon.

I just hoping the release will not break V3 (which it will) on other distros that are not at v6.11.

steved.

#14 lore raw
In reply to Jeff Layton
Quoted 53 lines · Jeff Layton

Hi Steve,

Here's an squashed version of the nfsdctl patches, that represents the latest changes. Let me know if you run into any other problems, and thanks for helping to test this!

---
Changes in v6:
- make the default number of threads 16 in autostart
- doc updates

Changes in v5:
- add support for pool-mode setting
- fix up the handling of nfsd_netlink.h in autoconf
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- add ability to specify an array of pool thread counts in nfs.conf
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- split nfsdctl.h so we can include the UAPI header as-is
- squash the patches together that added Lorenzo's version and convert it to the new interface
- adapt to latest version of netlink interface changes
+ have THREADS_SET/GET report an array of thread counts (one per pool)
+ pass scope in as a string to THREADS_SET instead of using unshare() trick

Changes in v2:
- Adapt to latest kernel netlink interface changes (in particular, send the leastime and gracetime when they are set in the config).
- More help text for different subcommands
- New nfsdctl(8) manpage
- Patch to make systemd preferentially use nfsdctl instead of rpc.nfsd
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Jeff Layton (3):
nfsdctl: add the nfsdctl utility to nfs-utils
nfsdctl: asciidoc source for the manpage
systemd: use nfsdctl to start and stop the nfs server

  configure.ac                 |   19 +
  systemd/nfs-server.service   |    4 +-
  utils/Makefile.am            |    4 +
  utils/nfsdctl/Makefile.am    |   13 +
  utils/nfsdctl/nfsd_netlink.h |   96 +++
  utils/nfsdctl/nfsdctl.8      |  304 ++++++++
  utils/nfsdctl/nfsdctl.adoc   |  158 +++++
  utils/nfsdctl/nfsdctl.c      | 1570 ++++++++++++++++++++++++++++++++++++++++++
  utils/nfsdctl/nfsdctl.h      |   93 +++
  9 files changed, 2259 insertions(+), 2 deletions(-)
Quoted 5 lines

---
base-commit: b76dbaa48f7c239accb0c2d1e1d51ddd73f4d6be
change-id: 20240412-nfsdctl-fa8bd8430cfd

Best regards,

Committed... (tag: nfs-utils-2-7-2-rc2)

Note: These changes need a v6.11 kernel for V3 to
come up properly

steved.

author maintainer
#15 lore raw
Quoted 59 lines · Steve Dickson
Quoted 57 lines · Jeff Layton

Hi Steve,

Here's an squashed version of the nfsdctl patches, that represents the latest changes. Let me know if you run into any other problems, and thanks for helping to test this!

---
Changes in v6:
- make the default number of threads 16 in autostart
- doc updates

Changes in v5:
- add support for pool-mode setting
- fix up the handling of nfsd_netlink.h in autoconf
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- add ability to specify an array of pool thread counts in nfs.conf
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- split nfsdctl.h so we can include the UAPI header as-is
- squash the patches together that added Lorenzo's version and convert it to the new interface
- adapt to latest version of netlink interface changes
+ have THREADS_SET/GET report an array of thread counts (one per pool)
+ pass scope in as a string to THREADS_SET instead of using unshare() trick

Changes in v2:
- Adapt to latest kernel netlink interface changes (in particular, send the leastime and gracetime when they are set in the config).
- More help text for different subcommands
- New nfsdctl(8) manpage
- Patch to make systemd preferentially use nfsdctl instead of rpc.nfsd
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Jeff Layton (3):
nfsdctl: add the nfsdctl utility to nfs-utils
nfsdctl: asciidoc source for the manpage
systemd: use nfsdctl to start and stop the nfs server

  configure.ac                 |   19 +
  systemd/nfs-server.service   |    4 +-
  utils/Makefile.am            |    4 +
  utils/nfsdctl/Makefile.am    |   13 +
  utils/nfsdctl/nfsd_netlink.h |   96 +++
  utils/nfsdctl/nfsdctl.8      |  304 ++++++++
  utils/nfsdctl/nfsdctl.adoc   |  158 +++++
  utils/nfsdctl/nfsdctl.c      | 1570 ++++++++++++++++++++++++++++++++++++++++++
  utils/nfsdctl/nfsdctl.h      |   93 +++
  9 files changed, 2259 insertions(+), 2 deletions(-)

---
base-commit: b76dbaa48f7c239accb0c2d1e1d51ddd73f4d6be
change-id: 20240412-nfsdctl-fa8bd8430cfd

Quoted 6 lines
Quoted 1 line

Best regards,

Committed... (tag: nfs-utils-2-7-2-rc2)

Note: These changes need a v6.11 kernel for V3 to
come up properly

Thanks! To be clear:

The "v3 problem" you're referring to was fixed in mainline by:

91da337e5d50 nfsd: don't set SVC_SOCK_ANONYMOUS when creating nfsd sockets

That patch also went into v6.10.5 (as 04c2c4d836ff) as well. Earlier kernels don't need it since they lack the relevant netlink interfaces altogether.

Signature · 1 line
Jeff Layton <[email protected]>