linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7 V4]  The NFSv4 only mounting daemon.
@ 2021-02-19 20:08 Steve Dickson
  2021-02-19 20:08 ` [PATCH 1/7] exportd: the initial shell of the v4 export support Steve Dickson
                   ` (9 more replies)
  0 siblings, 10 replies; 34+ messages in thread
From: Steve Dickson @ 2021-02-19 20:08 UTC (permalink / raw)
  To: Linux NFS Mailing list

nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
The idea is to allow distros to build a v4 only package
which will have a much smaller footprint than the
entire nfs-utils package.

exportd uses no RPC code, which means none of the 
code or arguments that deal with v3 was ported, 
this again, makes the footprint much smaller. 

The following options were ported:
    * multiple threads
    * state-directory-path option
    * junction support (not tested)

The rest of the mountd options were v3 only options.

V2:
  * Added two systemd services: nfsv4-exportd and nfsv4-server
  * nfsv4-server starts rpc.nfsd -N 3, so nfs.conf mod not needed.

V3: Changed the name from exportd to nfsv4.exportd

V4: Added compile flag that will compile in the NFSv4 only server

Steve Dickson (7):
  exportd: the initial shell of the v4 export support
  exportd: Moved cache upcalls routines into libexport.a
  exportd: multiple threads
  exportd/exportfs: Add the state-directory-path option
  exportd: Enabled junction support
  exportd: systemd unit files
  exportd: Added config variable to compile in the NFSv4 only server.

 .gitignore                                |   1 +
 configure.ac                              |  14 ++
 nfs.conf                                  |   4 +
 support/export/Makefile.am                |   3 +-
 {utils/mountd => support/export}/auth.c   |   4 +-
 {utils/mountd => support/export}/cache.c  |  46 +++-
 support/export/export.h                   |  34 +++
 {utils/mountd => support/export}/fsloc.c  |   0
 {utils/mountd => support/export}/v4root.c |   0
 {utils/mountd => support/include}/fsloc.h |   0
 systemd/Makefile.am                       |   6 +
 systemd/nfs.conf.man                      |  10 +
 systemd/nfsv4-exportd.service             |  12 +
 systemd/nfsv4-server.service              |  31 +++
 utils/Makefile.am                         |   4 +
 utils/exportd/Makefile.am                 |  65 +++++
 utils/exportd/exportd.c                   | 276 ++++++++++++++++++++++
 utils/exportd/exportd.man                 |  81 +++++++
 utils/exportfs/exportfs.c                 |  21 +-
 utils/exportfs/exportfs.man               |   7 +-
 utils/mountd/Makefile.am                  |   5 +-
 21 files changed, 606 insertions(+), 18 deletions(-)
 rename {utils/mountd => support/export}/auth.c (99%)
 rename {utils/mountd => support/export}/cache.c (98%)
 create mode 100644 support/export/export.h
 rename {utils/mountd => support/export}/fsloc.c (100%)
 rename {utils/mountd => support/export}/v4root.c (100%)
 rename {utils/mountd => support/include}/fsloc.h (100%)
 create mode 100644 systemd/nfsv4-exportd.service
 create mode 100644 systemd/nfsv4-server.service
 create mode 100644 utils/exportd/Makefile.am
 create mode 100644 utils/exportd/exportd.c
 create mode 100644 utils/exportd/exportd.man

-- 
2.29.2


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 1/7] exportd: the initial shell of the v4 export support
  2021-02-19 20:08 [PATCH 0/7 V4] The NFSv4 only mounting daemon Steve Dickson
@ 2021-02-19 20:08 ` Steve Dickson
  2021-02-19 20:08 ` [PATCH 2/7] exportd: Moved cache upcalls routines into libexport.a Steve Dickson
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 34+ messages in thread
From: Steve Dickson @ 2021-02-19 20:08 UTC (permalink / raw)
  To: Linux NFS Mailing list

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 .gitignore                |   1 +
 configure.ac              |   1 +
 utils/Makefile.am         |   1 +
 utils/exportd/Makefile.am |  58 ++++++++++++++++++
 utils/exportd/exportd.c   | 121 ++++++++++++++++++++++++++++++++++++++
 utils/exportd/exportd.man |  74 +++++++++++++++++++++++
 6 files changed, 256 insertions(+)
 create mode 100644 utils/exportd/Makefile.am
 create mode 100644 utils/exportd/exportd.c
 create mode 100644 utils/exportd/exportd.man

diff --git a/.gitignore b/.gitignore
index e97b31f..c89d1cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,6 +47,7 @@ utils/idmapd/idmapd
 utils/lockd/lockd
 utils/mount/mount.nfs
 utils/mountd/mountd
+utils/exportd/exportd
 utils/nfsd/nfsd
 utils/nfsstat/nfsstat
 utils/nhfsstone/nhfsstone
diff --git a/configure.ac b/configure.ac
index 50847d8..ffd6247 100644
--- a/configure.ac
+++ b/configure.ac
@@ -706,6 +706,7 @@ AC_CONFIG_FILES([
 	utils/idmapd/Makefile
 	utils/mount/Makefile
 	utils/mountd/Makefile
+	utils/exportd/Makefile
 	utils/nfsd/Makefile
 	utils/nfsref/Makefile
 	utils/nfsstat/Makefile
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 4c930a4..2a54b90 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -5,6 +5,7 @@ OPTDIRS =
 if CONFIG_NFSV4
 OPTDIRS += idmapd
 OPTDIRS += nfsidmap
+OPTDIRS += exportd
 endif
 
 if CONFIG_NFSV41
diff --git a/utils/exportd/Makefile.am b/utils/exportd/Makefile.am
new file mode 100644
index 0000000..6e61267
--- /dev/null
+++ b/utils/exportd/Makefile.am
@@ -0,0 +1,58 @@
+## Process this file with automake to produce Makefile.in
+
+OPTLIBS		=
+
+man8_MANS	= exportd.man
+EXTRA_DIST	= $(man8_MANS)
+
+NFSPREFIX	= nfsv4.
+KPREFIX		= @kprefix@
+sbin_PROGRAMS	= exportd
+
+exportd_SOURCES = exportd.c
+exportd_LDADD = ../../support/nfs/libnfs.la
+
+exportd_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS)
+
+MAINTAINERCLEANFILES = Makefile.in
+
+#######################################################################
+# The following allows the current practice of having
+# daemons renamed during the install to include NFSPREFIX
+# and the KPREFIX
+# This could all be done much easier with program_transform_name
+# ( program_transform_name = s/^/$(NFSPREFIX)$(KPREFIX)/ )
+# but that also renames the man pages, which the current
+# practice does not do.
+install-exec-hook:
+	(cd $(DESTDIR)$(sbindir) && \
+	  for p in $(sbin_PROGRAMS); do \
+	    mv -f $$p$(EXEEXT) $(NFSPREFIX)$(KPREFIX)$$p$(EXEEXT) ;\
+	  done)
+uninstall-hook:
+	(cd $(DESTDIR)$(sbindir) && \
+	  for p in $(sbin_PROGRAMS); do \
+	    rm -f $(NFSPREFIX)$(KPREFIX)$$p$(EXEEXT) ;\
+	  done)
+
+
+# XXX This makes some assumptions about what automake does.
+# XXX But there is no install-man-hook or install-man-local.
+install-man: install-man8 install-man-links
+uninstall-man: uninstall-man8 uninstall-man-links
+
+install-man-links:
+	(cd $(DESTDIR)$(man8dir) && \
+	  for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
+	    inst=`echo $$m | sed -e 's/man$$/8/'`; \
+	    rm -f $(NFSPREFIX)$$inst ; \
+	    $(LN_S) $$inst $(NFSPREFIX)$$inst ; \
+	  done)
+
+uninstall-man-links:
+	(cd $(DESTDIR)$(man8dir) && \
+	  for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
+	    inst=`echo $$m | sed -e 's/man$$/8/'`; \
+	    rm -f $(NFSPREFIX)$$inst ; \
+	  done)
+
diff --git a/utils/exportd/exportd.c b/utils/exportd/exportd.c
new file mode 100644
index 0000000..3a3dea6
--- /dev/null
+++ b/utils/exportd/exportd.c
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2021 Red Hat <nfs@redhat.com>
+ *
+ * support/exportd/exportd.c
+ *
+ * Routines used to support NFSv4 exports
+ *
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stddef.h>
+#include <unistd.h>
+#include <signal.h>
+#include <string.h>
+#include <getopt.h>
+
+#include "nfslib.h"
+#include "conffile.h"
+
+
+static struct option longopts[] =
+{
+	{ "foreground", 0, 0, 'F' },
+	{ "debug", 1, 0, 'd' },
+	{ "help", 0, 0, 'h' },
+	{ NULL, 0, 0, 0 }
+};
+
+/*
+ * Signal handlers.
+ */
+inline static void set_signals(void);
+
+static void 
+killer (int sig)
+{
+	xlog (L_NOTICE, "Caught signal %d, un-registering and exiting.", sig);
+	exit(0);
+}
+static void
+sig_hup (int UNUSED(sig))
+{
+	/* don't exit on SIGHUP */
+	xlog (L_NOTICE, "Received SIGHUP... Ignoring.\n");
+	return;
+}
+inline static void 
+set_signals(void) 
+{
+	struct sigaction sa;
+
+	sa.sa_handler = SIG_IGN;
+	sa.sa_flags = 0;
+	sigemptyset(&sa.sa_mask);
+	sigaction(SIGPIPE, &sa, NULL);
+	/* WARNING: the following works on Linux and SysV, but not BSD! */
+	sigaction(SIGCHLD, &sa, NULL);
+
+	sa.sa_handler = killer;
+	sigaction(SIGINT, &sa, NULL);
+	sigaction(SIGTERM, &sa, NULL);
+
+	sa.sa_handler = sig_hup;
+	sigaction(SIGHUP, &sa, NULL);
+}
+static void
+usage(const char *prog, int n)
+{
+	fprintf(stderr,
+		"Usage: %s [-f|--foreground] [-h|--help] [-d kind|--debug kind]\n", prog);
+	exit(n);
+}
+
+int
+main(int argc, char **argv)
+{
+	char *progname;
+	int	foreground = 0;
+	int	 c;
+
+	/* Set the basename */
+	if ((progname = strrchr(argv[0], '/')) != NULL)
+		progname++;
+	else
+		progname = argv[0];
+
+	/* Initialize logging. */
+	xlog_open(progname);
+
+	conf_init_file(NFS_CONFFILE);
+	xlog_set_debug(progname);
+
+	while ((c = getopt_long(argc, argv, "d:fh", longopts, NULL)) != EOF) {
+		switch (c) {
+		case 'd':
+			xlog_sconfig(optarg, 1);
+			break;
+		case 'f':
+			foreground++;
+			break;
+		case 'h':
+			usage(progname, 0);
+			break;
+		case '?':
+		default:
+			usage(progname, 1);
+		}
+
+	}
+
+	if (!foreground) 
+		xlog_stderr(0);
+
+	daemon_init(foreground);
+
+	set_signals();
+	
+	daemon_ready();
+}
diff --git a/utils/exportd/exportd.man b/utils/exportd/exportd.man
new file mode 100644
index 0000000..d786e57
--- /dev/null
+++ b/utils/exportd/exportd.man
@@ -0,0 +1,74 @@
+.\"@(#)nfsv4.exportd.8"
+.\"
+.\" Copyright (C) 2021 Red Hat <nfs@redhat.com>
+.\"
+.TH nfsv4.exportd 8 "02 Feb 2021"
+.SH NAME
+nfsv4.exportd \- NFSv4 Server Mount Daemon
+.SH SYNOPSIS
+.BI "/usr/sbin/nfsv4.exportd [" options "]"
+.SH DESCRIPTION
+The
+.B nfsv4.exportd
+is used to manage NFSv4 exports. The NFSv4 server
+receives a mount request from a client and pass it up to 
+.B nfsv4.exportd. 
+.B nfsv4.exportd 
+then uses the exports(5) export
+table to verify the validity of the mount request.
+.PP
+An NFS server maintains a table of local physical file systems
+that are accessible to NFS clients.
+Each file system in this table is referred to as an
+.IR "exported file system" ,
+or
+.IR export ,
+for short.
+.PP
+Each file system in the export table has an access control list.
+.B nfsv4.exportd
+uses these access control lists to determine
+whether an NFS client is permitted to access a given file system.
+For details on how to manage your NFS server's export table, see the
+.BR exports (5)
+and
+.BR exportfs (8)
+man pages.
+.SH OPTIONS
+.TP
+.B \-d kind " or " \-\-debug kind
+Turn on debugging. Valid kinds are: all, auth, call, general and parse.
+.TP
+.B \-F " or " \-\-foreground
+Run in foreground (do not daemonize)
+.TP
+.B \-h " or " \-\-help
+Display usage message.
+.SH CONFIGURATION FILE
+Many of the options that can be set on the command line can also be
+controlled through values set in the
+.B [exportd]
+or, in some cases, the
+.B [nfsd]
+sections of the
+.I /etc/nfs.conf
+configuration file.
+Values recognized in the
+.B [exportd]
+section include 
+.B debug 
+which each have the same effect as the option with the same name.
+.SH FILES
+.TP 2.5i
+.I /etc/exports
+input file for
+.BR exportfs ,
+listing exports, export options, and access control lists
+.SH SEE ALSO
+.BR exportfs (8),
+.BR exports (5),
+.BR showmount (8),
+.BR nfs.conf (5),
+.BR firwall-cmd (1),
+.sp
+RFC 3530 - "Network File System (NFS) version 4 Protocol"
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 2/7] exportd: Moved cache upcalls routines into libexport.a
  2021-02-19 20:08 [PATCH 0/7 V4] The NFSv4 only mounting daemon Steve Dickson
  2021-02-19 20:08 ` [PATCH 1/7] exportd: the initial shell of the v4 export support Steve Dickson
@ 2021-02-19 20:08 ` Steve Dickson
  2021-02-23 16:13   ` [PATCH] exportd: server-side gid management Daniel Kobras
  2021-02-19 20:08 ` [PATCH 3/7] exportd: multiple threads Steve Dickson
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 34+ messages in thread
From: Steve Dickson @ 2021-02-19 20:08 UTC (permalink / raw)
  To: Linux NFS Mailing list

Move the cache management code into libexport.a
so both mountd and exportd can use it.

Introduce cache_proccess_loop() which will
be used by exportd, instead of my_svc_run().

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 support/export/Makefile.am                |  3 +-
 {utils/mountd => support/export}/auth.c   |  4 +-
 {utils/mountd => support/export}/cache.c  | 46 +++++++++++++++++++++--
 support/export/export.h                   | 34 +++++++++++++++++
 {utils/mountd => support/export}/v4root.c |  0
 utils/exportd/Makefile.am                 |  8 +++-
 utils/exportd/exportd.c                   | 30 ++++++++++++++-
 utils/mountd/Makefile.am                  |  4 +-
 8 files changed, 118 insertions(+), 11 deletions(-)
 rename {utils/mountd => support/export}/auth.c (99%)
 rename {utils/mountd => support/export}/cache.c (98%)
 create mode 100644 support/export/export.h
 rename {utils/mountd => support/export}/v4root.c (100%)

diff --git a/support/export/Makefile.am b/support/export/Makefile.am
index 13f7a49..7de82a8 100644
--- a/support/export/Makefile.am
+++ b/support/export/Makefile.am
@@ -11,7 +11,8 @@ EXTRA_DIST	= mount.x
 
 noinst_LIBRARIES = libexport.a
 libexport_a_SOURCES = client.c export.c hostname.c \
-		      xtab.c mount_clnt.c mount_xdr.c
+		      xtab.c mount_clnt.c mount_xdr.c \
+			  cache.c auth.c v4root.c
 BUILT_SOURCES 	= $(GENFILES)
 
 noinst_HEADERS = mount.h
diff --git a/utils/mountd/auth.c b/support/export/auth.c
similarity index 99%
rename from utils/mountd/auth.c
rename to support/export/auth.c
index 67627f7..0bfa77d 100644
--- a/utils/mountd/auth.c
+++ b/support/export/auth.c
@@ -22,7 +22,7 @@
 #include "misc.h"
 #include "nfslib.h"
 #include "exportfs.h"
-#include "mountd.h"
+#include "export.h"
 #include "v4root.h"
 
 enum auth_error
@@ -43,11 +43,13 @@ extern int use_ipaddr;
 
 extern struct state_paths etab;
 
+/*
 void
 auth_init(void)
 {
 	auth_reload();
 }
+*/
 
 /*
  * A client can match many different netgroups and it's tough to know
diff --git a/utils/mountd/cache.c b/support/export/cache.c
similarity index 98%
rename from utils/mountd/cache.c
rename to support/export/cache.c
index a81e820..f1569af 100644
--- a/utils/mountd/cache.c
+++ b/support/export/cache.c
@@ -30,11 +30,14 @@
 #include "nfsd_path.h"
 #include "nfslib.h"
 #include "exportfs.h"
-#include "mountd.h"
-#include "fsloc.h"
+#include "export.h"
 #include "pseudoflavors.h"
 #include "xcommon.h"
 
+#ifdef HAVE_JUNCTION_SUPPORT
+#include "fsloc.h"
+#endif
+
 #ifdef USE_BLKID
 #include "blkid/blkid.h"
 #endif
@@ -44,6 +47,7 @@
  */
 void	cache_set_fds(fd_set *fdset);
 int	cache_process_req(fd_set *readfds);
+void cache_process_loop(void);
 
 enum nfsd_fsid {
 	FSID_DEV = 0,
@@ -909,6 +913,7 @@ out:
 	xlog(D_CALL, "nfsd_fh: found %p path %s", found, found ? found->e_path : NULL);
 }
 
+#ifdef HAVE_JUNCTION_SUPPORT
 static void write_fsloc(char **bp, int *blen, struct exportent *ep)
 {
 	struct servers *servers;
@@ -931,7 +936,7 @@ static void write_fsloc(char **bp, int *blen, struct exportent *ep)
 	qword_addint(bp, blen, servers->h_referral);
 	release_replicas(servers);
 }
-
+#endif
 static void write_secinfo(char **bp, int *blen, struct exportent *ep, int flag_mask)
 {
 	struct sec_entry *p;
@@ -974,7 +979,10 @@ static int dump_to_cache(int f, char *buf, int blen, char *domain,
 		qword_addint(&bp, &blen, exp->e_anonuid);
 		qword_addint(&bp, &blen, exp->e_anongid);
 		qword_addint(&bp, &blen, exp->e_fsid);
+
+#ifdef HAVE_JUNCTION_SUPPORT
 		write_fsloc(&bp, &blen, exp);
+#endif
 		write_secinfo(&bp, &blen, exp, flag_mask);
 		if (exp->e_uuid == NULL || different_fs) {
 			char u[16];
@@ -1509,6 +1517,38 @@ int cache_process_req(fd_set *readfds)
 	return cnt;
 }
 
+/**
+ * cache_process_loop - process incoming upcalls
+ */
+void cache_process_loop(void)
+{
+	fd_set	readfds;
+	int	selret;
+
+	FD_ZERO(&readfds);
+
+	for (;;) {
+
+		cache_set_fds(&readfds);
+
+		selret = select(FD_SETSIZE, &readfds,
+				(void *) 0, (void *) 0, (struct timeval *) 0);
+
+
+		switch (selret) {
+		case -1:
+			if (errno == EINTR || errno == ECONNREFUSED
+			 || errno == ENETUNREACH || errno == EHOSTUNREACH)
+				continue;
+			xlog(L_ERROR, "my_svc_run() - select: %m");
+			return;
+
+		default:
+			cache_process_req(&readfds);
+		}
+	}
+}
+
 
 /*
  * Give IP->domain and domain+path->options to kernel
diff --git a/support/export/export.h b/support/export/export.h
new file mode 100644
index 0000000..4296db1
--- /dev/null
+++ b/support/export/export.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2021 Red Hat <nfs@redhat.com>
+ *
+ * support/export/export.h
+ *
+ * Declarations for export support 
+ */
+
+#ifndef EXPORT_H
+#define EXPORT_H
+
+#include "nfslib.h"
+
+unsigned int	auth_reload(void);
+nfs_export *	auth_authenticate(const char *what,
+					const struct sockaddr *caller,
+					const char *path);
+
+void		cache_open(void);
+void		cache_process_loop(void);
+
+struct nfs_fh_len *
+		cache_get_filehandle(nfs_export *exp, int len, char *p);
+int		cache_export(nfs_export *exp, char *path);
+
+bool ipaddr_client_matches(nfs_export *exp, struct addrinfo *ai);
+bool namelist_client_matches(nfs_export *exp, char *dom);
+bool client_matches(nfs_export *exp, char *dom, struct addrinfo *ai);
+
+static inline bool is_ipaddr_client(char *dom)
+{
+	return dom[0] == '$';
+}
+#endif /* EXPORT__H */
diff --git a/utils/mountd/v4root.c b/support/export/v4root.c
similarity index 100%
rename from utils/mountd/v4root.c
rename to support/export/v4root.c
diff --git a/utils/exportd/Makefile.am b/utils/exportd/Makefile.am
index 6e61267..eb0f0a8 100644
--- a/utils/exportd/Makefile.am
+++ b/utils/exportd/Makefile.am
@@ -10,9 +10,13 @@ KPREFIX		= @kprefix@
 sbin_PROGRAMS	= exportd
 
 exportd_SOURCES = exportd.c
-exportd_LDADD = ../../support/nfs/libnfs.la
+exportd_LDADD = ../../support/export/libexport.a \
+			../../support/nfs/libnfs.la \
+			../../support/misc/libmisc.a \
+			$(OPTLIBS) $(LIBBLKID) $(LIBPTHREAD) 
 
-exportd_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS)
+exportd_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS) \
+		-I$(top_srcdir)/support/export
 
 MAINTAINERCLEANFILES = Makefile.in
 
diff --git a/utils/exportd/exportd.c b/utils/exportd/exportd.c
index 3a3dea6..2f67e3b 100644
--- a/utils/exportd/exportd.c
+++ b/utils/exportd/exportd.c
@@ -18,7 +18,16 @@
 
 #include "nfslib.h"
 #include "conffile.h"
+#include "exportfs.h"
+#include "export.h"
 
+extern void my_svc_run(void);
+
+struct state_paths etab;
+struct state_paths rmtab;
+
+int manage_gids;
+int use_ipaddr = -1;
 
 static struct option longopts[] =
 {
@@ -36,7 +45,7 @@ inline static void set_signals(void);
 static void 
 killer (int sig)
 {
-	xlog (L_NOTICE, "Caught signal %d, un-registering and exiting.", sig);
+	xlog (L_NOTICE, "Caught signal %d, exiting.", sig);
 	exit(0);
 }
 static void
@@ -110,12 +119,29 @@ main(int argc, char **argv)
 
 	}
 
+	if (!setup_state_path_names(progname, ETAB, ETABTMP, ETABLCK, &etab))
+		return 1;
+	if (!setup_state_path_names(progname, RMTAB, RMTABTMP, RMTABLCK, &rmtab))
+		return 1;
+
 	if (!foreground) 
 		xlog_stderr(0);
 
 	daemon_init(foreground);
 
 	set_signals();
-	
 	daemon_ready();
+
+	/* Open files now to avoid sharing descriptors among forked processes */
+	cache_open();
+
+	/* Process incoming upcalls */
+	cache_process_loop();
+
+	xlog(L_ERROR, "%s: process loop terminated unexpectedly. Exiting...\n",
+		progname);
+
+	free_state_path_names(&etab);
+	free_state_path_names(&rmtab);
+	exit(1);
 }
diff --git a/utils/mountd/Makefile.am b/utils/mountd/Makefile.am
index 18610f1..cac3275 100644
--- a/utils/mountd/Makefile.am
+++ b/utils/mountd/Makefile.am
@@ -13,8 +13,8 @@ KPREFIX		= @kprefix@
 sbin_PROGRAMS	= mountd
 
 noinst_HEADERS = fsloc.h
-mountd_SOURCES = mountd.c mount_dispatch.c auth.c rmtab.c cache.c \
-		 svc_run.c fsloc.c v4root.c mountd.h
+mountd_SOURCES = mountd.c mount_dispatch.c rmtab.c \
+		 svc_run.c fsloc.c mountd.h
 mountd_LDADD = ../../support/export/libexport.a \
 	       ../../support/nfs/libnfs.la \
 	       ../../support/misc/libmisc.a \
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 3/7] exportd: multiple threads
  2021-02-19 20:08 [PATCH 0/7 V4] The NFSv4 only mounting daemon Steve Dickson
  2021-02-19 20:08 ` [PATCH 1/7] exportd: the initial shell of the v4 export support Steve Dickson
  2021-02-19 20:08 ` [PATCH 2/7] exportd: Moved cache upcalls routines into libexport.a Steve Dickson
@ 2021-02-19 20:08 ` Steve Dickson
  2021-02-19 20:08 ` [PATCH 4/7] exportd/exportfs: Add the state-directory-path option Steve Dickson
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 34+ messages in thread
From: Steve Dickson @ 2021-02-19 20:08 UTC (permalink / raw)
  To: Linux NFS Mailing list

Ported the multiple thread code from mountd (commit 11d34d11)

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 nfs.conf                  |   3 +
 systemd/nfs.conf.man      |   9 +++
 utils/exportd/exportd.c   | 118 ++++++++++++++++++++++++++++++++++++--
 utils/exportd/exportd.man |   7 +++
 4 files changed, 133 insertions(+), 4 deletions(-)

diff --git a/nfs.conf b/nfs.conf
index 9fcf1bf..4b344fa 100644
--- a/nfs.conf
+++ b/nfs.conf
@@ -29,6 +29,9 @@
 # port=0
 # udp-port=0
 #
+[exportd]
+# debug="all|auth|call|general|parse"
+# threads=1
 [mountd]
 # debug="all|auth|call|general|parse"
 # manage-gids=n
diff --git a/systemd/nfs.conf.man b/systemd/nfs.conf.man
index 16e0ec4..a4379fd 100644
--- a/systemd/nfs.conf.man
+++ b/systemd/nfs.conf.man
@@ -128,6 +128,15 @@ then the client will be able to mount the path as
 but on the server, this will resolve to the path
 .BR /my/root/filesystem .
 
+.TP
+.B exportd
+Recognized values:
+.B threads
+
+See
+.BR exportd (8)
+for details.
+
 .TP
 .B nfsdcltrack
 Recognized values:
diff --git a/utils/exportd/exportd.c b/utils/exportd/exportd.c
index 2f67e3b..c814503 100644
--- a/utils/exportd/exportd.c
+++ b/utils/exportd/exportd.c
@@ -15,6 +15,8 @@
 #include <signal.h>
 #include <string.h>
 #include <getopt.h>
+#include <errno.h>
+#include <wait.h>
 
 #include "nfslib.h"
 #include "conffile.h"
@@ -26,6 +28,13 @@ extern void my_svc_run(void);
 struct state_paths etab;
 struct state_paths rmtab;
 
+/* Number of mountd threads to start.   Default is 1 and
+ * that's probably enough unless you need hundreds of
+ * clients to be able to mount at once.  */
+static int num_threads = 1;
+/* Arbitrary limit on number of threads */
+#define MAX_THREADS 64
+
 int manage_gids;
 int use_ipaddr = -1;
 
@@ -34,6 +43,7 @@ static struct option longopts[] =
 	{ "foreground", 0, 0, 'F' },
 	{ "debug", 1, 0, 'd' },
 	{ "help", 0, 0, 'h' },
+	{ "num-threads", 1, 0, 't' },
 	{ NULL, 0, 0, 0 }
 };
 
@@ -42,10 +52,85 @@ static struct option longopts[] =
  */
 inline static void set_signals(void);
 
+/* Wait for all worker child processes to exit and reap them */
+static void
+wait_for_workers (void)
+{
+	int status;
+	pid_t pid;
+
+	for (;;) {
+
+		pid = waitpid(0, &status, 0);
+
+		if (pid < 0) {
+			if (errno == ECHILD)
+				return; /* no more children */
+			xlog(L_FATAL, "mountd: can't wait: %s\n",
+					strerror(errno));
+		}
+
+		/* Note: because we SIG_IGN'd SIGCHLD earlier, this
+		 * does not happen on 2.6 kernels, and waitpid() blocks
+		 * until all the children are dead then returns with
+		 * -ECHILD.  But, we don't need to do anything on the
+		 * death of individual workers, so we don't care. */
+		xlog(L_NOTICE, "mountd: reaped child %d, status %d\n",
+				(int)pid, status);
+	}
+}
+
+/* Fork num_threads worker children and wait for them */
+static void
+fork_workers(void)
+{
+	int i;
+	pid_t pid;
+
+	xlog(L_NOTICE, "mountd: starting %d threads\n", num_threads);
+
+	for (i = 0 ; i < num_threads ; i++) {
+		pid = fork();
+		if (pid < 0) {
+			xlog(L_FATAL, "mountd: cannot fork: %s\n",
+					strerror(errno));
+		}
+		if (pid == 0) {
+			/* worker child */
+
+			/* Re-enable the default action on SIGTERM et al
+			 * so that workers die naturally when sent them.
+			 * Only the parent unregisters with pmap and
+			 * hence needs to do special SIGTERM handling. */
+			struct sigaction sa;
+			sa.sa_handler = SIG_DFL;
+			sa.sa_flags = 0;
+			sigemptyset(&sa.sa_mask);
+			sigaction(SIGHUP, &sa, NULL);
+			sigaction(SIGINT, &sa, NULL);
+			sigaction(SIGTERM, &sa, NULL);
+
+			/* fall into my_svc_run in caller */
+			return;
+		}
+	}
+
+	/* in parent */
+	wait_for_workers();
+	xlog(L_NOTICE, "exportd: no more workers, exiting\n");
+	exit(0);
+}
+
 static void 
 killer (int sig)
 {
+	if (num_threads > 1) {
+		/* play Kronos and eat our children */
+		kill(0, SIGTERM);
+		wait_for_workers();
+	}
 	xlog (L_NOTICE, "Caught signal %d, exiting.", sig);
+
 	exit(0);
 }
 static void
@@ -78,10 +163,20 @@ static void
 usage(const char *prog, int n)
 {
 	fprintf(stderr,
-		"Usage: %s [-f|--foreground] [-h|--help] [-d kind|--debug kind]\n", prog);
+		"Usage: %s [-f|--foreground] [-h|--help] [-d kind|--debug kind]\n"
+"	[-t num|--num-threads=num]\n", prog);
 	exit(n);
 }
 
+inline static void 
+read_exportd_conf(char *progname)
+{
+	conf_init_file(NFS_CONFFILE);
+
+	xlog_set_debug(progname);
+
+	num_threads = conf_get_num("exportd", "threads", num_threads);
+}
 int
 main(int argc, char **argv)
 {
@@ -98,10 +193,10 @@ main(int argc, char **argv)
 	/* Initialize logging. */
 	xlog_open(progname);
 
-	conf_init_file(NFS_CONFFILE);
-	xlog_set_debug(progname);
+	/* Read in config setting */
+	read_exportd_conf(progname);
 
-	while ((c = getopt_long(argc, argv, "d:fh", longopts, NULL)) != EOF) {
+	while ((c = getopt_long(argc, argv, "d:fht:", longopts, NULL)) != EOF) {
 		switch (c) {
 		case 'd':
 			xlog_sconfig(optarg, 1);
@@ -112,6 +207,9 @@ main(int argc, char **argv)
 		case 'h':
 			usage(progname, 0);
 			break;
+		case 't':
+			num_threads = atoi (optarg);
+			break;
 		case '?':
 		default:
 			usage(progname, 1);
@@ -132,6 +230,18 @@ main(int argc, char **argv)
 	set_signals();
 	daemon_ready();
 
+	/* silently bounds check num_threads */
+	if (foreground)
+		num_threads = 1;
+	else if (num_threads < 1)
+		num_threads = 1;
+	else if (num_threads > MAX_THREADS)
+		num_threads = MAX_THREADS;
+
+	if (num_threads > 1)
+		fork_workers();
+
+
 	/* Open files now to avoid sharing descriptors among forked processes */
 	cache_open();
 
diff --git a/utils/exportd/exportd.man b/utils/exportd/exportd.man
index d786e57..1d65b5e 100644
--- a/utils/exportd/exportd.man
+++ b/utils/exportd/exportd.man
@@ -44,6 +44,13 @@ Run in foreground (do not daemonize)
 .TP
 .B \-h " or " \-\-help
 Display usage message.
+.TP
+.BR "\-t N" " or " "\-\-num\-threads=N " or  " \-\-num\-threads N "
+This option specifies the number of worker threads that rpc.mountd
+spawns.  The default is 1 thread, which is probably enough.  More
+threads are usually only needed for NFS servers which need to handle
+mount storms of hundreds of NFS mounts in a few seconds, or when
+your DNS server is slow or unreliable.
 .SH CONFIGURATION FILE
 Many of the options that can be set on the command line can also be
 controlled through values set in the
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 4/7] exportd/exportfs: Add the state-directory-path option
  2021-02-19 20:08 [PATCH 0/7 V4] The NFSv4 only mounting daemon Steve Dickson
                   ` (2 preceding siblings ...)
  2021-02-19 20:08 ` [PATCH 3/7] exportd: multiple threads Steve Dickson
@ 2021-02-19 20:08 ` Steve Dickson
  2021-02-19 20:08 ` [PATCH 5/7] exportd: Enabled junction support Steve Dickson
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 34+ messages in thread
From: Steve Dickson @ 2021-02-19 20:08 UTC (permalink / raw)
  To: Linux NFS Mailing list

Ported state-directory-path option from mountd (commit a15bd948)
Signed-off-by: Steve Dickson <steved@redhat.com>
---
 nfs.conf                    |  1 +
 systemd/nfs.conf.man        |  3 ++-
 utils/exportd/exportd.c     | 35 +++++++++++++++++++++++++++--------
 utils/exportfs/exportfs.c   | 21 +++++++++++++--------
 utils/exportfs/exportfs.man |  7 +++++--
 5 files changed, 48 insertions(+), 19 deletions(-)

diff --git a/nfs.conf b/nfs.conf
index 4b344fa..bebb2e3 100644
--- a/nfs.conf
+++ b/nfs.conf
@@ -31,6 +31,7 @@
 #
 [exportd]
 # debug="all|auth|call|general|parse"
+# state-directory-path=/var/lib/nfs
 # threads=1
 [mountd]
 # debug="all|auth|call|general|parse"
diff --git a/systemd/nfs.conf.man b/systemd/nfs.conf.man
index a4379fd..d2187f8 100644
--- a/systemd/nfs.conf.man
+++ b/systemd/nfs.conf.man
@@ -131,7 +131,8 @@ but on the server, this will resolve to the path
 .TP
 .B exportd
 Recognized values:
-.B threads
+.BR threads ,
+.BR state-directory-path
 
 See
 .BR exportd (8)
diff --git a/utils/exportd/exportd.c b/utils/exportd/exportd.c
index c814503..7130bcb 100644
--- a/utils/exportd/exportd.c
+++ b/utils/exportd/exportd.c
@@ -26,7 +26,6 @@
 extern void my_svc_run(void);
 
 struct state_paths etab;
-struct state_paths rmtab;
 
 /* Number of mountd threads to start.   Default is 1 and
  * that's probably enough unless you need hundreds of
@@ -80,6 +79,12 @@ wait_for_workers (void)
 	}
 }
 
+inline void
+cleanup_lockfiles (void)
+{
+	unlink(etab.lockfn);
+}
+
 /* Fork num_threads worker children and wait for them */
 static void
 fork_workers(void)
@@ -117,6 +122,8 @@ fork_workers(void)
 
 	/* in parent */
 	wait_for_workers();
+	cleanup_lockfiles();
+	free_state_path_names(&etab);
 	xlog(L_NOTICE, "exportd: no more workers, exiting\n");
 	exit(0);
 }
@@ -129,6 +136,8 @@ killer (int sig)
 		kill(0, SIGTERM);
 		wait_for_workers();
 	}
+	cleanup_lockfiles();
+	free_state_path_names(&etab);
 	xlog (L_NOTICE, "Caught signal %d, exiting.", sig);
 
 	exit(0);
@@ -159,24 +168,33 @@ set_signals(void)
 	sa.sa_handler = sig_hup;
 	sigaction(SIGHUP, &sa, NULL);
 }
+
 static void
 usage(const char *prog, int n)
 {
 	fprintf(stderr,
 		"Usage: %s [-f|--foreground] [-h|--help] [-d kind|--debug kind]\n"
+"	[-s|--state-directory-path path]\n"
 "	[-t num|--num-threads=num]\n", prog);
 	exit(n);
 }
 
 inline static void 
-read_exportd_conf(char *progname)
+read_exportd_conf(char *progname, char **argv)
 {
+	char *s;
+
 	conf_init_file(NFS_CONFFILE);
 
 	xlog_set_debug(progname);
 
 	num_threads = conf_get_num("exportd", "threads", num_threads);
+
+	s = conf_get_str("exportd", "state-directory-path");
+	if (s && !state_setup_basedir(argv[0], s))
+		exit(1);
 }
+
 int
 main(int argc, char **argv)
 {
@@ -194,9 +212,9 @@ main(int argc, char **argv)
 	xlog_open(progname);
 
 	/* Read in config setting */
-	read_exportd_conf(progname);
+	read_exportd_conf(progname, argv);
 
-	while ((c = getopt_long(argc, argv, "d:fht:", longopts, NULL)) != EOF) {
+	while ((c = getopt_long(argc, argv, "d:fhs:t:", longopts, NULL)) != EOF) {
 		switch (c) {
 		case 'd':
 			xlog_sconfig(optarg, 1);
@@ -207,6 +225,10 @@ main(int argc, char **argv)
 		case 'h':
 			usage(progname, 0);
 			break;
+		case 's':
+			if (!state_setup_basedir(argv[0], optarg))
+				exit(1);
+			break;
 		case 't':
 			num_threads = atoi (optarg);
 			break;
@@ -219,9 +241,7 @@ main(int argc, char **argv)
 
 	if (!setup_state_path_names(progname, ETAB, ETABTMP, ETABLCK, &etab))
 		return 1;
-	if (!setup_state_path_names(progname, RMTAB, RMTABTMP, RMTABLCK, &rmtab))
-		return 1;
-
+	
 	if (!foreground) 
 		xlog_stderr(0);
 
@@ -252,6 +272,5 @@ main(int argc, char **argv)
 		progname);
 
 	free_state_path_names(&etab);
-	free_state_path_names(&rmtab);
 	exit(1);
 }
diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
index f8b446a..262dd19 100644
--- a/utils/exportfs/exportfs.c
+++ b/utils/exportfs/exportfs.c
@@ -92,10 +92,21 @@ release_lockfile()
 	}
 }
 inline static void 
-read_exportfs_conf(void)
+read_exportfs_conf(char **argv)
 {
+	char *s;
+
 	conf_init_file(NFS_CONFFILE);
 	xlog_set_debug("exportfs");
+
+	/* NOTE: following uses "mountd" section of nfs.conf !!!! */
+	s = conf_get_str("mountd", "state-directory-path");
+	/* Also look in the exportd section */
+	if (s == NULL)
+		s = conf_get_str("exportd", "state-directory-path");
+	if (s && !state_setup_basedir(argv[0], s))
+		exit(1);
+
 }
 int
 main(int argc, char **argv)
@@ -110,7 +121,6 @@ main(int argc, char **argv)
 	int	f_ignore = 0;
 	int	i, c;
 	int	force_flush = 0;
-	char	*s;
 
 	if ((progname = strrchr(argv[0], '/')) != NULL)
 		progname++;
@@ -122,15 +132,10 @@ main(int argc, char **argv)
 	xlog_syslog(0);
 
 	/* Read in config setting */
-	read_exportfs_conf();
+	read_exportfs_conf(argv);
 
 	nfsd_path_init();
 
-	/* NOTE: following uses "mountd" section of nfs.conf !!!! */
-	s = conf_get_str("mountd", "state-directory-path");
-	if (s && !state_setup_basedir(argv[0], s))
-		exit(1);
-
 	while ((c = getopt(argc, argv, "ad:fhio:ruvs")) != EOF) {
 		switch(c) {
 		case 'a':
diff --git a/utils/exportfs/exportfs.man b/utils/exportfs/exportfs.man
index 91d3589..6d417a7 100644
--- a/utils/exportfs/exportfs.man
+++ b/utils/exportfs/exportfs.man
@@ -167,9 +167,11 @@ When a list is given, the members should be comma-separated.
 .B exportfs
 will also recognize the
 .B state-directory-path
-value from the
+value from both the 
 .B [mountd]
-section.
+section and the
+.B [exportd]
+section
 
 .SH DISCUSSION
 .SS Exporting Directories
@@ -327,6 +329,7 @@ table of clients accessing server's exports
 .BR exports (5),
 .BR nfs.conf (5),
 .BR rpc.mountd (8),
+.BR exportd (8),
 .BR netgroup (5)
 .SH AUTHORS
 Olaf Kirch <okir@monad.swb.de>
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 5/7] exportd: Enabled junction support
  2021-02-19 20:08 [PATCH 0/7 V4] The NFSv4 only mounting daemon Steve Dickson
                   ` (3 preceding siblings ...)
  2021-02-19 20:08 ` [PATCH 4/7] exportd/exportfs: Add the state-directory-path option Steve Dickson
@ 2021-02-19 20:08 ` Steve Dickson
  2021-02-19 20:08 ` [PATCH 6/7] exportd: systemd unit files Steve Dickson
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 34+ messages in thread
From: Steve Dickson @ 2021-02-19 20:08 UTC (permalink / raw)
  To: Linux NFS Mailing list

Moved the junction support from mountd to libexport.a
so both exportd and mountd can use the code.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 support/export/Makefile.am                | 2 +-
 {utils/mountd => support/export}/fsloc.c  | 0
 {utils/mountd => support/include}/fsloc.h | 0
 utils/exportd/Makefile.am                 | 3 +++
 utils/mountd/Makefile.am                  | 3 +--
 5 files changed, 5 insertions(+), 3 deletions(-)
 rename {utils/mountd => support/export}/fsloc.c (100%)
 rename {utils/mountd => support/include}/fsloc.h (100%)

diff --git a/support/export/Makefile.am b/support/export/Makefile.am
index 7de82a8..a9e710c 100644
--- a/support/export/Makefile.am
+++ b/support/export/Makefile.am
@@ -12,7 +12,7 @@ EXTRA_DIST	= mount.x
 noinst_LIBRARIES = libexport.a
 libexport_a_SOURCES = client.c export.c hostname.c \
 		      xtab.c mount_clnt.c mount_xdr.c \
-			  cache.c auth.c v4root.c
+			  cache.c auth.c v4root.c fsloc.c
 BUILT_SOURCES 	= $(GENFILES)
 
 noinst_HEADERS = mount.h
diff --git a/utils/mountd/fsloc.c b/support/export/fsloc.c
similarity index 100%
rename from utils/mountd/fsloc.c
rename to support/export/fsloc.c
diff --git a/utils/mountd/fsloc.h b/support/include/fsloc.h
similarity index 100%
rename from utils/mountd/fsloc.h
rename to support/include/fsloc.h
diff --git a/utils/exportd/Makefile.am b/utils/exportd/Makefile.am
index eb0f0a8..eb521f1 100644
--- a/utils/exportd/Makefile.am
+++ b/utils/exportd/Makefile.am
@@ -1,6 +1,9 @@
 ## Process this file with automake to produce Makefile.in
 
 OPTLIBS		=
+if CONFIG_JUNCTION
+OPTLIBS		+= ../../support/junction/libjunction.la $(LIBXML2)
+endif
 
 man8_MANS	= exportd.man
 EXTRA_DIST	= $(man8_MANS)
diff --git a/utils/mountd/Makefile.am b/utils/mountd/Makefile.am
index cac3275..859f28e 100644
--- a/utils/mountd/Makefile.am
+++ b/utils/mountd/Makefile.am
@@ -12,9 +12,8 @@ RPCPREFIX	= rpc.
 KPREFIX		= @kprefix@
 sbin_PROGRAMS	= mountd
 
-noinst_HEADERS = fsloc.h
 mountd_SOURCES = mountd.c mount_dispatch.c rmtab.c \
-		 svc_run.c fsloc.c mountd.h
+		 svc_run.c mountd.h
 mountd_LDADD = ../../support/export/libexport.a \
 	       ../../support/nfs/libnfs.la \
 	       ../../support/misc/libmisc.a \
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 6/7] exportd: systemd unit files
  2021-02-19 20:08 [PATCH 0/7 V4] The NFSv4 only mounting daemon Steve Dickson
                   ` (4 preceding siblings ...)
  2021-02-19 20:08 ` [PATCH 5/7] exportd: Enabled junction support Steve Dickson
@ 2021-02-19 20:08 ` Steve Dickson
  2021-02-19 20:08 ` [PATCH 7/7] exportd: Added config variable to compile in the NFSv4 only server Steve Dickson
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 34+ messages in thread
From: Steve Dickson @ 2021-02-19 20:08 UTC (permalink / raw)
  To: Linux NFS Mailing list

Created two new systemd unit services
based on nfs-mountd and nfs-service

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 systemd/Makefile.am           |  4 +++-
 systemd/nfsv4-exportd.service | 12 ++++++++++++
 systemd/nfsv4-server.service  | 31 +++++++++++++++++++++++++++++++
 3 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 systemd/nfsv4-exportd.service
 create mode 100644 systemd/nfsv4-server.service

diff --git a/systemd/Makefile.am b/systemd/Makefile.am
index 75cdd9f..5251f23 100644
--- a/systemd/Makefile.am
+++ b/systemd/Makefile.am
@@ -17,7 +17,9 @@ unit_files =  \
 
 if CONFIG_NFSV4
 unit_files += \
-    nfs-idmapd.service
+    nfs-idmapd.service \
+    nfsv4-exportd.service \
+    nfsv4-server.service
 endif
 
 if CONFIG_NFSV41
diff --git a/systemd/nfsv4-exportd.service b/systemd/nfsv4-exportd.service
new file mode 100644
index 0000000..11d663a
--- /dev/null
+++ b/systemd/nfsv4-exportd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=NFSv4 Mount Daemon
+DefaultDependencies=no
+Requires=proc-fs-nfsd.mount
+Wants=network-online.target
+After=proc-fs-nfsd.mount
+After=network-online.target local-fs.target
+BindsTo=nfsv4-server.service
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/nfsv4.exportd
diff --git a/systemd/nfsv4-server.service b/systemd/nfsv4-server.service
new file mode 100644
index 0000000..6497568
--- /dev/null
+++ b/systemd/nfsv4-server.service
@@ -0,0 +1,31 @@
+[Unit]
+Description=NFSv4 server and services
+DefaultDependencies=no
+Requires=network.target proc-fs-nfsd.mount
+Requires=nfsv4-exportd.service
+Wants=network-online.target
+Wants=nfs-idmapd.service
+Wants=nfsdcld.service
+
+After=network-online.target local-fs.target
+After=proc-fs-nfsd.mount nfsv4-exportd.service
+After=nfs-idmapd.service
+After=nfsdcld.service
+
+# GSS services dependencies and ordering
+Wants=auth-rpcgss-module.service
+After=rpc-gssd.service gssproxy.service rpc-svcgssd.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStartPre=-/usr/sbin/exportfs -r
+ExecStart=/usr/sbin/rpc.nfsd -N 3
+ExecStop=/usr/sbin/rpc.nfsd 0
+ExecStopPost=/usr/sbin/exportfs -au
+ExecStopPost=/usr/sbin/exportfs -f
+
+ExecReload=-/usr/sbin/exportfs -r
+
+[Install]
+WantedBy=multi-user.target
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 7/7] exportd: Added config variable to compile in the NFSv4 only server.
  2021-02-19 20:08 [PATCH 0/7 V4] The NFSv4 only mounting daemon Steve Dickson
                   ` (5 preceding siblings ...)
  2021-02-19 20:08 ` [PATCH 6/7] exportd: systemd unit files Steve Dickson
@ 2021-02-19 20:08 ` Steve Dickson
  2021-02-20 16:33 ` [PATCH 0/7 V4] The NFSv4 only mounting daemon Steve Dickson
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 34+ messages in thread
From: Steve Dickson @ 2021-02-19 20:08 UTC (permalink / raw)
  To: Linux NFS Mailing list

Added the --enable-nfsv4server configuration flag
that will compile/install nfsv4.exportd and
install the systemd unit files.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 configure.ac        | 13 +++++++++++++
 systemd/Makefile.am |  6 +++++-
 utils/Makefile.am   |  3 +++
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index ffd6247..40fb802 100644
--- a/configure.ac
+++ b/configure.ac
@@ -257,6 +257,19 @@ AC_ARG_ENABLE(nfsdcltrack,
 	enable_nfsdcltrack=$enableval,
 	enable_nfsdcltrack="yes")
 
+if test "$enable_nfsv4" = yes; then
+AC_ARG_ENABLE(nfsv4server,
+	[AC_HELP_STRING([--enable-nfsv4server],
+			[enable support for NFSv4 only server  @<:@default=no@:>@])],
+	enable_nfsv4server=$enableval,
+	enable_nfsv4server="no")
+	if test "$enable_nfsv4server" = yes; then
+		AC_DEFINE(HAVE_NFSV4SERVER_SUPPORT, 1,
+                          [Define this if you want NFSv4 server only support compiled in])
+	fi
+	AM_CONDITIONAL(CONFIG_NFSV4SERVER, [test "$enable_nfsv4server" = "yes" ])
+fi
+
 dnl Check for TI-RPC library and headers
 AC_LIBTIRPC
 
diff --git a/systemd/Makefile.am b/systemd/Makefile.am
index 5251f23..650ad25 100644
--- a/systemd/Makefile.am
+++ b/systemd/Makefile.am
@@ -17,7 +17,11 @@ unit_files =  \
 
 if CONFIG_NFSV4
 unit_files += \
-    nfs-idmapd.service \
+    nfs-idmapd.service
+endif
+
+if CONFIG_NFSV4SERVER
+unit_files += \
     nfsv4-exportd.service \
     nfsv4-server.service
 endif
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 2a54b90..ab58419 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -5,6 +5,9 @@ OPTDIRS =
 if CONFIG_NFSV4
 OPTDIRS += idmapd
 OPTDIRS += nfsidmap
+endif
+
+if CONFIG_NFSV4SERVER
 OPTDIRS += exportd
 endif
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-02-19 20:08 [PATCH 0/7 V4] The NFSv4 only mounting daemon Steve Dickson
                   ` (6 preceding siblings ...)
  2021-02-19 20:08 ` [PATCH 7/7] exportd: Added config variable to compile in the NFSv4 only server Steve Dickson
@ 2021-02-20 16:33 ` Steve Dickson
  2021-02-24 20:30 ` J. Bruce Fields
  2021-02-24 20:49 ` J. Bruce Fields
  9 siblings, 0 replies; 34+ messages in thread
From: Steve Dickson @ 2021-02-20 16:33 UTC (permalink / raw)
  To: Linux NFS Mailing list



On 2/19/21 3:08 PM, Steve Dickson wrote:
> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
> The idea is to allow distros to build a v4 only package
> which will have a much smaller footprint than the
> entire nfs-utils package.
> 
> exportd uses no RPC code, which means none of the 
> code or arguments that deal with v3 was ported, 
> this again, makes the footprint much smaller. 
> 
> The following options were ported:
>     * multiple threads
>     * state-directory-path option
>     * junction support (not tested)
> 
> The rest of the mountd options were v3 only options.
> 
> V2:
>   * Added two systemd services: nfsv4-exportd and nfsv4-server
>   * nfsv4-server starts rpc.nfsd -N 3, so nfs.conf mod not needed.
> 
> V3: Changed the name from exportd to nfsv4.exportd
> 
> V4: Added compile flag that will compile in the NFSv4 only server
Patch set Committed... (tag:  nfs-utils-2-5-3-rc6)

steved.
> 
> Steve Dickson (7):
>   exportd: the initial shell of the v4 export support
>   exportd: Moved cache upcalls routines into libexport.a
>   exportd: multiple threads
>   exportd/exportfs: Add the state-directory-path option
>   exportd: Enabled junction support
>   exportd: systemd unit files
>   exportd: Added config variable to compile in the NFSv4 only server.
> 
>  .gitignore                                |   1 +
>  configure.ac                              |  14 ++
>  nfs.conf                                  |   4 +
>  support/export/Makefile.am                |   3 +-
>  {utils/mountd => support/export}/auth.c   |   4 +-
>  {utils/mountd => support/export}/cache.c  |  46 +++-
>  support/export/export.h                   |  34 +++
>  {utils/mountd => support/export}/fsloc.c  |   0
>  {utils/mountd => support/export}/v4root.c |   0
>  {utils/mountd => support/include}/fsloc.h |   0
>  systemd/Makefile.am                       |   6 +
>  systemd/nfs.conf.man                      |  10 +
>  systemd/nfsv4-exportd.service             |  12 +
>  systemd/nfsv4-server.service              |  31 +++
>  utils/Makefile.am                         |   4 +
>  utils/exportd/Makefile.am                 |  65 +++++
>  utils/exportd/exportd.c                   | 276 ++++++++++++++++++++++
>  utils/exportd/exportd.man                 |  81 +++++++
>  utils/exportfs/exportfs.c                 |  21 +-
>  utils/exportfs/exportfs.man               |   7 +-
>  utils/mountd/Makefile.am                  |   5 +-
>  21 files changed, 606 insertions(+), 18 deletions(-)
>  rename {utils/mountd => support/export}/auth.c (99%)
>  rename {utils/mountd => support/export}/cache.c (98%)
>  create mode 100644 support/export/export.h
>  rename {utils/mountd => support/export}/fsloc.c (100%)
>  rename {utils/mountd => support/export}/v4root.c (100%)
>  rename {utils/mountd => support/include}/fsloc.h (100%)
>  create mode 100644 systemd/nfsv4-exportd.service
>  create mode 100644 systemd/nfsv4-server.service
>  create mode 100644 utils/exportd/Makefile.am
>  create mode 100644 utils/exportd/exportd.c
>  create mode 100644 utils/exportd/exportd.man
> 


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH] exportd: server-side gid management
  2021-02-19 20:08 ` [PATCH 2/7] exportd: Moved cache upcalls routines into libexport.a Steve Dickson
@ 2021-02-23 16:13   ` Daniel Kobras
  2021-03-04 21:28     ` Steve Dickson
  0 siblings, 1 reply; 34+ messages in thread
From: Daniel Kobras @ 2021-02-23 16:13 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing list

Ported manage-gids option from mountd

Signed-off-by: Daniel Kobras <kobras@puzzle-itc.de>
---
Hi Steve!

Option --manage-gids should still be useful with NFSv4 and AUTH_SYS, but 
commit 15dc0bead10d20c31e72ca94ce21eb66dc3528d5 does not allow to actually
control the global variable manage_gids from exportd. I assume something
like the following was intended?

Kind regards,

Daniel

 nfs.conf                  |  1 +
 utils/exportd/exportd.c   |  8 +++++++-
 utils/exportd/exportd.man | 16 ++++++++++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/nfs.conf b/nfs.conf
index bebb2e3d..e69ec16d 100644
--- a/nfs.conf
+++ b/nfs.conf
@@ -31,6 +31,7 @@
 #
 [exportd]
 # debug="all|auth|call|general|parse"
+# manage-gids=n
 # state-directory-path=/var/lib/nfs
 # threads=1
 [mountd]
diff --git a/utils/exportd/exportd.c b/utils/exportd/exportd.c
index 7130bcbf..0d7782be 100644
--- a/utils/exportd/exportd.c
+++ b/utils/exportd/exportd.c
@@ -42,6 +42,7 @@ static struct option longopts[] =
 	{ "foreground", 0, 0, 'F' },
 	{ "debug", 1, 0, 'd' },
 	{ "help", 0, 0, 'h' },
+	{ "manage-gids", 0, 0, 'g' },
 	{ "num-threads", 1, 0, 't' },
 	{ NULL, 0, 0, 0 }
 };
@@ -174,6 +175,7 @@ usage(const char *prog, int n)
 {
 	fprintf(stderr,
 		"Usage: %s [-f|--foreground] [-h|--help] [-d kind|--debug kind]\n"
+"	[-g|--manage-gids]\n"
 "	[-s|--state-directory-path path]\n"
 "	[-t num|--num-threads=num]\n", prog);
 	exit(n);
@@ -188,6 +190,7 @@ read_exportd_conf(char *progname, char **argv)
 
 	xlog_set_debug(progname);
 
+	manage_gids = conf_get_bool("exportd", "manage-gids", manage_gids);
 	num_threads = conf_get_num("exportd", "threads", num_threads);
 
 	s = conf_get_str("exportd", "state-directory-path");
@@ -214,7 +217,7 @@ main(int argc, char **argv)
 	/* Read in config setting */
 	read_exportd_conf(progname, argv);
 
-	while ((c = getopt_long(argc, argv, "d:fhs:t:", longopts, NULL)) != EOF) {
+	while ((c = getopt_long(argc, argv, "d:fghs:t:", longopts, NULL)) != EOF) {
 		switch (c) {
 		case 'd':
 			xlog_sconfig(optarg, 1);
@@ -222,6 +225,9 @@ main(int argc, char **argv)
 		case 'f':
 			foreground++;
 			break;
+		case 'g':
+			manage_gids = 1;
+			break;
 		case 'h':
 			usage(progname, 0);
 			break;
diff --git a/utils/exportd/exportd.man b/utils/exportd/exportd.man
index 1d65b5e0..d7884562 100644
--- a/utils/exportd/exportd.man
+++ b/utils/exportd/exportd.man
@@ -51,6 +51,21 @@ spawns.  The default is 1 thread, which is probably enough.  More
 threads are usually only needed for NFS servers which need to handle
 mount storms of hundreds of NFS mounts in a few seconds, or when
 your DNS server is slow or unreliable.
+.TP
+.BR \-g " or " \-\-manage-gids
+Accept requests from the kernel to map user id numbers into lists of
+group id numbers for use in access control.  An NFS request will
+normally (except when using Kerberos or other cryptographic
+authentication) contain a user-id and a list of group-ids.  Due to a
+limitation in the NFS protocol, at most 16 groups ids can be listed.
+If you use the
+.B \-g
+flag, then the list of group ids received from the client will be
+replaced by a list of group ids determined by an appropriate lookup on
+the server. Note that the 'primary' group id is not affected so a
+.B newgroup
+command on the client will still be effective.  This function requires
+a Linux Kernel with version at least 2.6.21.
 .SH CONFIGURATION FILE
 Many of the options that can be set on the command line can also be
 controlled through values set in the
@@ -63,6 +78,7 @@ configuration file.
 Values recognized in the
 .B [exportd]
 section include 
+.BR manage-gids ", and"
 .B debug 
 which each have the same effect as the option with the same name.
 .SH FILES
-- 
2.25.1


-- 
Puzzle ITC Deutschland GmbH
Sitz der Gesellschaft: Eisenbahnstraße 1, 72072 
Tübingen

Eingetragen am Amtsgericht Stuttgart HRB 765802
Geschäftsführer: 
Lukas Kallies, Daniel Kobras, Mark Pröhl


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4]  The NFSv4 only mounting daemon.
  2021-02-19 20:08 [PATCH 0/7 V4] The NFSv4 only mounting daemon Steve Dickson
                   ` (7 preceding siblings ...)
  2021-02-20 16:33 ` [PATCH 0/7 V4] The NFSv4 only mounting daemon Steve Dickson
@ 2021-02-24 20:30 ` J. Bruce Fields
  2021-03-02 22:33   ` Steve Dickson
  2021-02-24 20:49 ` J. Bruce Fields
  9 siblings, 1 reply; 34+ messages in thread
From: J. Bruce Fields @ 2021-02-24 20:30 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing list

On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
> The idea is to allow distros to build a v4 only package
> which will have a much smaller footprint than the
> entire nfs-utils package.
> 
> exportd uses no RPC code, which means none of the 
> code or arguments that deal with v3 was ported, 
> this again, makes the footprint much smaller. 

How much smaller?

> The following options were ported:
>     * multiple threads
>     * state-directory-path option
>     * junction support (not tested)
> 
> The rest of the mountd options were v3 only options.

There's also --manage-gids.

If you want nfsv4-only at runtime, you can always run rpc.mountd with
-N2 -N3 to turn off the MOUNT protocol support.

If you don't even want v2/f3 code on your system, then you may have to
do something like this, but why is that important?

--b.

> 
> V2:
>   * Added two systemd services: nfsv4-exportd and nfsv4-server
>   * nfsv4-server starts rpc.nfsd -N 3, so nfs.conf mod not needed.
> 
> V3: Changed the name from exportd to nfsv4.exportd
> 
> V4: Added compile flag that will compile in the NFSv4 only server
> 
> Steve Dickson (7):
>   exportd: the initial shell of the v4 export support
>   exportd: Moved cache upcalls routines into libexport.a
>   exportd: multiple threads
>   exportd/exportfs: Add the state-directory-path option
>   exportd: Enabled junction support
>   exportd: systemd unit files
>   exportd: Added config variable to compile in the NFSv4 only server.
> 
>  .gitignore                                |   1 +
>  configure.ac                              |  14 ++
>  nfs.conf                                  |   4 +
>  support/export/Makefile.am                |   3 +-
>  {utils/mountd => support/export}/auth.c   |   4 +-
>  {utils/mountd => support/export}/cache.c  |  46 +++-
>  support/export/export.h                   |  34 +++
>  {utils/mountd => support/export}/fsloc.c  |   0
>  {utils/mountd => support/export}/v4root.c |   0
>  {utils/mountd => support/include}/fsloc.h |   0
>  systemd/Makefile.am                       |   6 +
>  systemd/nfs.conf.man                      |  10 +
>  systemd/nfsv4-exportd.service             |  12 +
>  systemd/nfsv4-server.service              |  31 +++
>  utils/Makefile.am                         |   4 +
>  utils/exportd/Makefile.am                 |  65 +++++
>  utils/exportd/exportd.c                   | 276 ++++++++++++++++++++++
>  utils/exportd/exportd.man                 |  81 +++++++
>  utils/exportfs/exportfs.c                 |  21 +-
>  utils/exportfs/exportfs.man               |   7 +-
>  utils/mountd/Makefile.am                  |   5 +-
>  21 files changed, 606 insertions(+), 18 deletions(-)
>  rename {utils/mountd => support/export}/auth.c (99%)
>  rename {utils/mountd => support/export}/cache.c (98%)
>  create mode 100644 support/export/export.h
>  rename {utils/mountd => support/export}/fsloc.c (100%)
>  rename {utils/mountd => support/export}/v4root.c (100%)
>  rename {utils/mountd => support/include}/fsloc.h (100%)
>  create mode 100644 systemd/nfsv4-exportd.service
>  create mode 100644 systemd/nfsv4-server.service
>  create mode 100644 utils/exportd/Makefile.am
>  create mode 100644 utils/exportd/exportd.c
>  create mode 100644 utils/exportd/exportd.man
> 
> -- 
> 2.29.2

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4]  The NFSv4 only mounting daemon.
  2021-02-19 20:08 [PATCH 0/7 V4] The NFSv4 only mounting daemon Steve Dickson
                   ` (8 preceding siblings ...)
  2021-02-24 20:30 ` J. Bruce Fields
@ 2021-02-24 20:49 ` J. Bruce Fields
  2021-03-02 22:39   ` Steve Dickson
  9 siblings, 1 reply; 34+ messages in thread
From: J. Bruce Fields @ 2021-02-24 20:49 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing list

On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
> The idea is to allow distros to build a v4 only package
> which will have a much smaller footprint than the
> entire nfs-utils package.
> 
> exportd uses no RPC code, which means none of the 
> code or arguments that deal with v3 was ported, 
> this again, makes the footprint much smaller. 
> 
> The following options were ported:
>     * multiple threads
>     * state-directory-path option
>     * junction support (not tested)
> 
> The rest of the mountd options were v3 only options.
> 
> V2:
>   * Added two systemd services: nfsv4-exportd and nfsv4-server
>   * nfsv4-server starts rpc.nfsd -N 3, so nfs.conf mod not needed.

We really shouldn't make users change how they do things.

Whatever we do, "systemctl start nfs-server" should still be how they
start the NFS server.

--b.

> 
> V3: Changed the name from exportd to nfsv4.exportd
> 
> V4: Added compile flag that will compile in the NFSv4 only server
> 
> Steve Dickson (7):
>   exportd: the initial shell of the v4 export support
>   exportd: Moved cache upcalls routines into libexport.a
>   exportd: multiple threads
>   exportd/exportfs: Add the state-directory-path option
>   exportd: Enabled junction support
>   exportd: systemd unit files
>   exportd: Added config variable to compile in the NFSv4 only server.
> 
>  .gitignore                                |   1 +
>  configure.ac                              |  14 ++
>  nfs.conf                                  |   4 +
>  support/export/Makefile.am                |   3 +-
>  {utils/mountd => support/export}/auth.c   |   4 +-
>  {utils/mountd => support/export}/cache.c  |  46 +++-
>  support/export/export.h                   |  34 +++
>  {utils/mountd => support/export}/fsloc.c  |   0
>  {utils/mountd => support/export}/v4root.c |   0
>  {utils/mountd => support/include}/fsloc.h |   0
>  systemd/Makefile.am                       |   6 +
>  systemd/nfs.conf.man                      |  10 +
>  systemd/nfsv4-exportd.service             |  12 +
>  systemd/nfsv4-server.service              |  31 +++
>  utils/Makefile.am                         |   4 +
>  utils/exportd/Makefile.am                 |  65 +++++
>  utils/exportd/exportd.c                   | 276 ++++++++++++++++++++++
>  utils/exportd/exportd.man                 |  81 +++++++
>  utils/exportfs/exportfs.c                 |  21 +-
>  utils/exportfs/exportfs.man               |   7 +-
>  utils/mountd/Makefile.am                  |   5 +-
>  21 files changed, 606 insertions(+), 18 deletions(-)
>  rename {utils/mountd => support/export}/auth.c (99%)
>  rename {utils/mountd => support/export}/cache.c (98%)
>  create mode 100644 support/export/export.h
>  rename {utils/mountd => support/export}/fsloc.c (100%)
>  rename {utils/mountd => support/export}/v4root.c (100%)
>  rename {utils/mountd => support/include}/fsloc.h (100%)
>  create mode 100644 systemd/nfsv4-exportd.service
>  create mode 100644 systemd/nfsv4-server.service
>  create mode 100644 utils/exportd/Makefile.am
>  create mode 100644 utils/exportd/exportd.c
>  create mode 100644 utils/exportd/exportd.man
> 
> -- 
> 2.29.2

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-02-24 20:30 ` J. Bruce Fields
@ 2021-03-02 22:33   ` Steve Dickson
  2021-03-03 15:23     ` J. Bruce Fields
  0 siblings, 1 reply; 34+ messages in thread
From: Steve Dickson @ 2021-03-02 22:33 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux NFS Mailing list



On 2/24/21 3:30 PM, J. Bruce Fields wrote:
> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
>> The idea is to allow distros to build a v4 only package
>> which will have a much smaller footprint than the
>> entire nfs-utils package.
>>
>> exportd uses no RPC code, which means none of the 
>> code or arguments that deal with v3 was ported, 
>> this again, makes the footprint much smaller. 
> 
> How much smaller?
Will a bit smaller... but a number of daemons like nfsd[cld,clddb,cldnts]
need to also come a long. 
> 
>> The following options were ported:
>>     * multiple threads
>>     * state-directory-path option
>>     * junction support (not tested)
>>
>> The rest of the mountd options were v3 only options.
> 
> There's also --manage-gids.
Right... a patch was posted... 

> 
> If you want nfsv4-only at runtime, you can always run rpc.mountd with
> -N2 -N3 to turn off the MOUNT protocol support.
The end game is not to run mountd at all... 

> 
> If you don't even want v2/f3 code on your system, then you may have to
> do something like this, but why is that important?
Container friendly... Not bring in all the extra daemons v3
needs is a good thing... esp rpcbind. 

steved.

> 
> --b.
> 
>>
>> V2:
>>   * Added two systemd services: nfsv4-exportd and nfsv4-server
>>   * nfsv4-server starts rpc.nfsd -N 3, so nfs.conf mod not needed.
>>
>> V3: Changed the name from exportd to nfsv4.exportd
>>
>> V4: Added compile flag that will compile in the NFSv4 only server
>>
>> Steve Dickson (7):
>>   exportd: the initial shell of the v4 export support
>>   exportd: Moved cache upcalls routines into libexport.a
>>   exportd: multiple threads
>>   exportd/exportfs: Add the state-directory-path option
>>   exportd: Enabled junction support
>>   exportd: systemd unit files
>>   exportd: Added config variable to compile in the NFSv4 only server.
>>
>>  .gitignore                                |   1 +
>>  configure.ac                              |  14 ++
>>  nfs.conf                                  |   4 +
>>  support/export/Makefile.am                |   3 +-
>>  {utils/mountd => support/export}/auth.c   |   4 +-
>>  {utils/mountd => support/export}/cache.c  |  46 +++-
>>  support/export/export.h                   |  34 +++
>>  {utils/mountd => support/export}/fsloc.c  |   0
>>  {utils/mountd => support/export}/v4root.c |   0
>>  {utils/mountd => support/include}/fsloc.h |   0
>>  systemd/Makefile.am                       |   6 +
>>  systemd/nfs.conf.man                      |  10 +
>>  systemd/nfsv4-exportd.service             |  12 +
>>  systemd/nfsv4-server.service              |  31 +++
>>  utils/Makefile.am                         |   4 +
>>  utils/exportd/Makefile.am                 |  65 +++++
>>  utils/exportd/exportd.c                   | 276 ++++++++++++++++++++++
>>  utils/exportd/exportd.man                 |  81 +++++++
>>  utils/exportfs/exportfs.c                 |  21 +-
>>  utils/exportfs/exportfs.man               |   7 +-
>>  utils/mountd/Makefile.am                  |   5 +-
>>  21 files changed, 606 insertions(+), 18 deletions(-)
>>  rename {utils/mountd => support/export}/auth.c (99%)
>>  rename {utils/mountd => support/export}/cache.c (98%)
>>  create mode 100644 support/export/export.h
>>  rename {utils/mountd => support/export}/fsloc.c (100%)
>>  rename {utils/mountd => support/export}/v4root.c (100%)
>>  rename {utils/mountd => support/include}/fsloc.h (100%)
>>  create mode 100644 systemd/nfsv4-exportd.service
>>  create mode 100644 systemd/nfsv4-server.service
>>  create mode 100644 utils/exportd/Makefile.am
>>  create mode 100644 utils/exportd/exportd.c
>>  create mode 100644 utils/exportd/exportd.man
>>
>> -- 
>> 2.29.2
> 


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-02-24 20:49 ` J. Bruce Fields
@ 2021-03-02 22:39   ` Steve Dickson
  2021-03-03 18:10     ` Chuck Lever
  0 siblings, 1 reply; 34+ messages in thread
From: Steve Dickson @ 2021-03-02 22:39 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux NFS Mailing list



On 2/24/21 3:49 PM, J. Bruce Fields wrote:
> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
>> The idea is to allow distros to build a v4 only package
>> which will have a much smaller footprint than the
>> entire nfs-utils package.
>>
>> exportd uses no RPC code, which means none of the 
>> code or arguments that deal with v3 was ported, 
>> this again, makes the footprint much smaller. 
>>
>> The following options were ported:
>>     * multiple threads
>>     * state-directory-path option
>>     * junction support (not tested)
>>
>> The rest of the mountd options were v3 only options.
>>
>> V2:
>>   * Added two systemd services: nfsv4-exportd and nfsv4-server
>>   * nfsv4-server starts rpc.nfsd -N 3, so nfs.conf mod not needed.
> 
> We really shouldn't make users change how they do things.
If they only want v4 support...  I'm thinking is a lot easier to
simple do a nfsv4.server start verse edit config files.
  
> 
> Whatever we do, "systemctl start nfs-server" should still be how they
> start the NFS server.
Again.. if they install the nfsv4-utils verse the nfs-utils package
they should expect change... IMHO..

steved.
> 
> --b.
> 
>>
>> V3: Changed the name from exportd to nfsv4.exportd
>>
>> V4: Added compile flag that will compile in the NFSv4 only server
>>
>> Steve Dickson (7):
>>   exportd: the initial shell of the v4 export support
>>   exportd: Moved cache upcalls routines into libexport.a
>>   exportd: multiple threads
>>   exportd/exportfs: Add the state-directory-path option
>>   exportd: Enabled junction support
>>   exportd: systemd unit files
>>   exportd: Added config variable to compile in the NFSv4 only server.
>>
>>  .gitignore                                |   1 +
>>  configure.ac                              |  14 ++
>>  nfs.conf                                  |   4 +
>>  support/export/Makefile.am                |   3 +-
>>  {utils/mountd => support/export}/auth.c   |   4 +-
>>  {utils/mountd => support/export}/cache.c  |  46 +++-
>>  support/export/export.h                   |  34 +++
>>  {utils/mountd => support/export}/fsloc.c  |   0
>>  {utils/mountd => support/export}/v4root.c |   0
>>  {utils/mountd => support/include}/fsloc.h |   0
>>  systemd/Makefile.am                       |   6 +
>>  systemd/nfs.conf.man                      |  10 +
>>  systemd/nfsv4-exportd.service             |  12 +
>>  systemd/nfsv4-server.service              |  31 +++
>>  utils/Makefile.am                         |   4 +
>>  utils/exportd/Makefile.am                 |  65 +++++
>>  utils/exportd/exportd.c                   | 276 ++++++++++++++++++++++
>>  utils/exportd/exportd.man                 |  81 +++++++
>>  utils/exportfs/exportfs.c                 |  21 +-
>>  utils/exportfs/exportfs.man               |   7 +-
>>  utils/mountd/Makefile.am                  |   5 +-
>>  21 files changed, 606 insertions(+), 18 deletions(-)
>>  rename {utils/mountd => support/export}/auth.c (99%)
>>  rename {utils/mountd => support/export}/cache.c (98%)
>>  create mode 100644 support/export/export.h
>>  rename {utils/mountd => support/export}/fsloc.c (100%)
>>  rename {utils/mountd => support/export}/v4root.c (100%)
>>  rename {utils/mountd => support/include}/fsloc.h (100%)
>>  create mode 100644 systemd/nfsv4-exportd.service
>>  create mode 100644 systemd/nfsv4-server.service
>>  create mode 100644 utils/exportd/Makefile.am
>>  create mode 100644 utils/exportd/exportd.c
>>  create mode 100644 utils/exportd/exportd.man
>>
>> -- 
>> 2.29.2
> 


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-02 22:33   ` Steve Dickson
@ 2021-03-03 15:23     ` J. Bruce Fields
  2021-03-03 21:22       ` Steve Dickson
  2021-03-04 13:34       ` Steve Dickson
  0 siblings, 2 replies; 34+ messages in thread
From: J. Bruce Fields @ 2021-03-03 15:23 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing list

On Tue, Mar 02, 2021 at 05:33:23PM -0500, Steve Dickson wrote:
> 
> 
> On 2/24/21 3:30 PM, J. Bruce Fields wrote:
> > On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
> >> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
> >> The idea is to allow distros to build a v4 only package
> >> which will have a much smaller footprint than the
> >> entire nfs-utils package.
> >>
> >> exportd uses no RPC code, which means none of the 
> >> code or arguments that deal with v3 was ported, 
> >> this again, makes the footprint much smaller. 
> > 
> > How much smaller?
> Will a bit smaller... but a number of daemons like nfsd[cld,clddb,cldnts]
> need to also come a long. 

Could we get some numbers?

Looks like nfs-utils in F33 is about 1.2M:

$ rpm -qi nfs-utils|grep ^Size
Size        : 1243512

$ strip utils/mountd/mountd
$ ls -lh utils/mountd/mountd
-rwxrwxr-x. 1 bfields bfields 128K Mar  3 10:12 utils/mountd/mountd
$ strip utils/exportd/exportd
$ ls -lh utils/exportd/exportd
-rwxrwxr-x. 1 bfields bfields 106K Mar  3 10:12 utils/exportd/exportd

So replacing mountd by exportd saves us about 20K out of 1.2M.  Is it
worth it?

> >> The following options were ported:
> >>     * multiple threads
> >>     * state-directory-path option
> >>     * junction support (not tested)
> >>
> >> The rest of the mountd options were v3 only options.
> > 
> > There's also --manage-gids.
> Right... a patch was posted... 
> 
> > 
> > If you want nfsv4-only at runtime, you can always run rpc.mountd with
> > -N2 -N3 to turn off the MOUNT protocol support.
> The end game is not to run mountd at all... 
> 
> > 
> > If you don't even want v2/f3 code on your system, then you may have to
> > do something like this, but why is that important?
> Container friendly... Not bring in all the extra daemons v3
> needs is a good thing... esp rpcbind. 

Looking at the output of
$ for f in $(rpm -ql nfs-utils); do if [ -f $f ]; then ls -ls $f; fi; done|sort -n

It looks like removing statd, sm-notify, showount and their man pages
would free about another 170K.

I think that's about how much we'd save by seperating out a separate
documentation package.

I don't know, what sort of gains are container folks asking for?

--b.

> 
> steved.
> 
> > 
> > --b.
> > 
> >>
> >> V2:
> >>   * Added two systemd services: nfsv4-exportd and nfsv4-server
> >>   * nfsv4-server starts rpc.nfsd -N 3, so nfs.conf mod not needed.
> >>
> >> V3: Changed the name from exportd to nfsv4.exportd
> >>
> >> V4: Added compile flag that will compile in the NFSv4 only server
> >>
> >> Steve Dickson (7):
> >>   exportd: the initial shell of the v4 export support
> >>   exportd: Moved cache upcalls routines into libexport.a
> >>   exportd: multiple threads
> >>   exportd/exportfs: Add the state-directory-path option
> >>   exportd: Enabled junction support
> >>   exportd: systemd unit files
> >>   exportd: Added config variable to compile in the NFSv4 only server.
> >>
> >>  .gitignore                                |   1 +
> >>  configure.ac                              |  14 ++
> >>  nfs.conf                                  |   4 +
> >>  support/export/Makefile.am                |   3 +-
> >>  {utils/mountd => support/export}/auth.c   |   4 +-
> >>  {utils/mountd => support/export}/cache.c  |  46 +++-
> >>  support/export/export.h                   |  34 +++
> >>  {utils/mountd => support/export}/fsloc.c  |   0
> >>  {utils/mountd => support/export}/v4root.c |   0
> >>  {utils/mountd => support/include}/fsloc.h |   0
> >>  systemd/Makefile.am                       |   6 +
> >>  systemd/nfs.conf.man                      |  10 +
> >>  systemd/nfsv4-exportd.service             |  12 +
> >>  systemd/nfsv4-server.service              |  31 +++
> >>  utils/Makefile.am                         |   4 +
> >>  utils/exportd/Makefile.am                 |  65 +++++
> >>  utils/exportd/exportd.c                   | 276 ++++++++++++++++++++++
> >>  utils/exportd/exportd.man                 |  81 +++++++
> >>  utils/exportfs/exportfs.c                 |  21 +-
> >>  utils/exportfs/exportfs.man               |   7 +-
> >>  utils/mountd/Makefile.am                  |   5 +-
> >>  21 files changed, 606 insertions(+), 18 deletions(-)
> >>  rename {utils/mountd => support/export}/auth.c (99%)
> >>  rename {utils/mountd => support/export}/cache.c (98%)
> >>  create mode 100644 support/export/export.h
> >>  rename {utils/mountd => support/export}/fsloc.c (100%)
> >>  rename {utils/mountd => support/export}/v4root.c (100%)
> >>  rename {utils/mountd => support/include}/fsloc.h (100%)
> >>  create mode 100644 systemd/nfsv4-exportd.service
> >>  create mode 100644 systemd/nfsv4-server.service
> >>  create mode 100644 utils/exportd/Makefile.am
> >>  create mode 100644 utils/exportd/exportd.c
> >>  create mode 100644 utils/exportd/exportd.man
> >>
> >> -- 
> >> 2.29.2
> > 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-02 22:39   ` Steve Dickson
@ 2021-03-03 18:10     ` Chuck Lever
  2021-03-03 21:24       ` Steve Dickson
  0 siblings, 1 reply; 34+ messages in thread
From: Chuck Lever @ 2021-03-03 18:10 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Bruce Fields, Linux NFS Mailing List



> On Mar 2, 2021, at 5:39 PM, Steve Dickson <SteveD@RedHat.com> wrote:
> 
> 
> 
> On 2/24/21 3:49 PM, J. Bruce Fields wrote:
>> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
>>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
>>> The idea is to allow distros to build a v4 only package
>>> which will have a much smaller footprint than the
>>> entire nfs-utils package.
>>> 
>>> exportd uses no RPC code, which means none of the 
>>> code or arguments that deal with v3 was ported, 
>>> this again, makes the footprint much smaller. 
>>> 
>>> The following options were ported:
>>>    * multiple threads
>>>    * state-directory-path option
>>>    * junction support (not tested)
>>> 
>>> The rest of the mountd options were v3 only options.
>>> 
>>> V2:
>>>  * Added two systemd services: nfsv4-exportd and nfsv4-server
>>>  * nfsv4-server starts rpc.nfsd -N 3, so nfs.conf mod not needed.
>> 
>> We really shouldn't make users change how they do things.
> If they only want v4 support...  I'm thinking is a lot easier to
> simple do a nfsv4.server start verse edit config files.
> 
>> 
>> Whatever we do, "systemctl start nfs-server" should still be how they
>> start the NFS server.
> Again.. if they install the nfsv4-utils verse the nfs-utils package
> they should expect change... IMHO..

I would prefer having a single nfs-utils package. I don't see
a need for a proliferation of these extra little programs --
let's just make the usual suspects behave better.


> steved.
>> 
>> --b.
>> 
>>> 
>>> V3: Changed the name from exportd to nfsv4.exportd
>>> 
>>> V4: Added compile flag that will compile in the NFSv4 only server
>>> 
>>> Steve Dickson (7):
>>>  exportd: the initial shell of the v4 export support
>>>  exportd: Moved cache upcalls routines into libexport.a
>>>  exportd: multiple threads
>>>  exportd/exportfs: Add the state-directory-path option
>>>  exportd: Enabled junction support
>>>  exportd: systemd unit files
>>>  exportd: Added config variable to compile in the NFSv4 only server.
>>> 
>>> .gitignore                                |   1 +
>>> configure.ac                              |  14 ++
>>> nfs.conf                                  |   4 +
>>> support/export/Makefile.am                |   3 +-
>>> {utils/mountd => support/export}/auth.c   |   4 +-
>>> {utils/mountd => support/export}/cache.c  |  46 +++-
>>> support/export/export.h                   |  34 +++
>>> {utils/mountd => support/export}/fsloc.c  |   0
>>> {utils/mountd => support/export}/v4root.c |   0
>>> {utils/mountd => support/include}/fsloc.h |   0
>>> systemd/Makefile.am                       |   6 +
>>> systemd/nfs.conf.man                      |  10 +
>>> systemd/nfsv4-exportd.service             |  12 +
>>> systemd/nfsv4-server.service              |  31 +++
>>> utils/Makefile.am                         |   4 +
>>> utils/exportd/Makefile.am                 |  65 +++++
>>> utils/exportd/exportd.c                   | 276 ++++++++++++++++++++++
>>> utils/exportd/exportd.man                 |  81 +++++++
>>> utils/exportfs/exportfs.c                 |  21 +-
>>> utils/exportfs/exportfs.man               |   7 +-
>>> utils/mountd/Makefile.am                  |   5 +-
>>> 21 files changed, 606 insertions(+), 18 deletions(-)
>>> rename {utils/mountd => support/export}/auth.c (99%)
>>> rename {utils/mountd => support/export}/cache.c (98%)
>>> create mode 100644 support/export/export.h
>>> rename {utils/mountd => support/export}/fsloc.c (100%)
>>> rename {utils/mountd => support/export}/v4root.c (100%)
>>> rename {utils/mountd => support/include}/fsloc.h (100%)
>>> create mode 100644 systemd/nfsv4-exportd.service
>>> create mode 100644 systemd/nfsv4-server.service
>>> create mode 100644 utils/exportd/Makefile.am
>>> create mode 100644 utils/exportd/exportd.c
>>> create mode 100644 utils/exportd/exportd.man
>>> 
>>> -- 
>>> 2.29.2

--
Chuck Lever




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-03 15:23     ` J. Bruce Fields
@ 2021-03-03 21:22       ` Steve Dickson
  2021-03-03 21:54         ` J. Bruce Fields
  2021-03-04 13:34       ` Steve Dickson
  1 sibling, 1 reply; 34+ messages in thread
From: Steve Dickson @ 2021-03-03 21:22 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux NFS Mailing list

Hey!

On 3/3/21 10:23 AM, J. Bruce Fields wrote:
> On Tue, Mar 02, 2021 at 05:33:23PM -0500, Steve Dickson wrote:
>>
>>
>> On 2/24/21 3:30 PM, J. Bruce Fields wrote:
>>> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
>>>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
>>>> The idea is to allow distros to build a v4 only package
>>>> which will have a much smaller footprint than the
>>>> entire nfs-utils package.
>>>>
>>>> exportd uses no RPC code, which means none of the 
>>>> code or arguments that deal with v3 was ported, 
>>>> this again, makes the footprint much smaller. 
>>>
>>> How much smaller?
>> Will a bit smaller... but a number of daemons like nfsd[cld,clddb,cldnts]
>> need to also come a long. 
> 
> Could we get some numbers?
> 
> Looks like nfs-utils in F33 is about 1.2M:
> 
> $ rpm -qi nfs-utils|grep ^Size
> Size        : 1243512
> 
> $ strip utils/mountd/mountd
> $ ls -lh utils/mountd/mountd
> -rwxrwxr-x. 1 bfields bfields 128K Mar  3 10:12 utils/mountd/mountd
> $ strip utils/exportd/exportd
> $ ls -lh utils/exportd/exportd
> -rwxrwxr-x. 1 bfields bfields 106K Mar  3 10:12 utils/exportd/exportd
> 
> So replacing mountd by exportd saves us about 20K out of 1.2M.  Is it
> worth it?
In smaller foot print I guess I meant no v3 daemons, esp rpcbind. 

It is not surprising mountd and exportd are similar size since
they are using the same code to do the same thing. With the only
exception is exportd does not have any RPC code. It only handles 
upcalls from the kernel.

> 
>>>> The following options were ported:
>>>>     * multiple threads
>>>>     * state-directory-path option
>>>>     * junction support (not tested)
>>>>
>>>> The rest of the mountd options were v3 only options.
>>>
>>> There's also --manage-gids.
>> Right... a patch was posted... 
>>
>>>
>>> If you want nfsv4-only at runtime, you can always run rpc.mountd with
>>> -N2 -N3 to turn off the MOUNT protocol support.
>> The end game is not to run mountd at all... 
>>
>>>
>>> If you don't even want v2/f3 code on your system, then you may have to
>>> do something like this, but why is that important?
>> Container friendly... Not bring in all the extra daemons v3
>> needs is a good thing... esp rpcbind. 
> 
> Looking at the output of
> $ for f in $(rpm -ql nfs-utils); do if [ -f $f ]; then ls -ls $f; fi; done|sort -n
> 
> It looks like removing statd, sm-notify, showount and their man pages
> would free about another 170K.
And rpcbind and rpcinfo... But thanks for taking a look.

> 
> I think that's about how much we'd save by seperating out a separate
> documentation package.
hmm... interesting idea.

> 
> I don't know, what sort of gains are container folks asking for?
It is my understanding rpcbind and containers do not play nicely. 

Plus I don't think it is a bad idea to be able just install
and nfsv4 client or just install an nfsv4 server.
Maybe I'm wrong??

steved.

> 
> --b.
> 
>>
>> steved.
>>
>>>
>>> --b.
>>>
>>>>
>>>> V2:
>>>>   * Added two systemd services: nfsv4-exportd and nfsv4-server
>>>>   * nfsv4-server starts rpc.nfsd -N 3, so nfs.conf mod not needed.
>>>>
>>>> V3: Changed the name from exportd to nfsv4.exportd
>>>>
>>>> V4: Added compile flag that will compile in the NFSv4 only server
>>>>
>>>> Steve Dickson (7):
>>>>   exportd: the initial shell of the v4 export support
>>>>   exportd: Moved cache upcalls routines into libexport.a
>>>>   exportd: multiple threads
>>>>   exportd/exportfs: Add the state-directory-path option
>>>>   exportd: Enabled junction support
>>>>   exportd: systemd unit files
>>>>   exportd: Added config variable to compile in the NFSv4 only server.
>>>>
>>>>  .gitignore                                |   1 +
>>>>  configure.ac                              |  14 ++
>>>>  nfs.conf                                  |   4 +
>>>>  support/export/Makefile.am                |   3 +-
>>>>  {utils/mountd => support/export}/auth.c   |   4 +-
>>>>  {utils/mountd => support/export}/cache.c  |  46 +++-
>>>>  support/export/export.h                   |  34 +++
>>>>  {utils/mountd => support/export}/fsloc.c  |   0
>>>>  {utils/mountd => support/export}/v4root.c |   0
>>>>  {utils/mountd => support/include}/fsloc.h |   0
>>>>  systemd/Makefile.am                       |   6 +
>>>>  systemd/nfs.conf.man                      |  10 +
>>>>  systemd/nfsv4-exportd.service             |  12 +
>>>>  systemd/nfsv4-server.service              |  31 +++
>>>>  utils/Makefile.am                         |   4 +
>>>>  utils/exportd/Makefile.am                 |  65 +++++
>>>>  utils/exportd/exportd.c                   | 276 ++++++++++++++++++++++
>>>>  utils/exportd/exportd.man                 |  81 +++++++
>>>>  utils/exportfs/exportfs.c                 |  21 +-
>>>>  utils/exportfs/exportfs.man               |   7 +-
>>>>  utils/mountd/Makefile.am                  |   5 +-
>>>>  21 files changed, 606 insertions(+), 18 deletions(-)
>>>>  rename {utils/mountd => support/export}/auth.c (99%)
>>>>  rename {utils/mountd => support/export}/cache.c (98%)
>>>>  create mode 100644 support/export/export.h
>>>>  rename {utils/mountd => support/export}/fsloc.c (100%)
>>>>  rename {utils/mountd => support/export}/v4root.c (100%)
>>>>  rename {utils/mountd => support/include}/fsloc.h (100%)
>>>>  create mode 100644 systemd/nfsv4-exportd.service
>>>>  create mode 100644 systemd/nfsv4-server.service
>>>>  create mode 100644 utils/exportd/Makefile.am
>>>>  create mode 100644 utils/exportd/exportd.c
>>>>  create mode 100644 utils/exportd/exportd.man
>>>>
>>>> -- 
>>>> 2.29.2
>>>
> 


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-03 18:10     ` Chuck Lever
@ 2021-03-03 21:24       ` Steve Dickson
  0 siblings, 0 replies; 34+ messages in thread
From: Steve Dickson @ 2021-03-03 21:24 UTC (permalink / raw)
  To: Chuck Lever; +Cc: Bruce Fields, Linux NFS Mailing List



On 3/3/21 1:10 PM, Chuck Lever wrote:
> 
> 
>> On Mar 2, 2021, at 5:39 PM, Steve Dickson <SteveD@RedHat.com> wrote:
>>
>>
>>
>> On 2/24/21 3:49 PM, J. Bruce Fields wrote:
>>> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
>>>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
>>>> The idea is to allow distros to build a v4 only package
>>>> which will have a much smaller footprint than the
>>>> entire nfs-utils package.
>>>>
>>>> exportd uses no RPC code, which means none of the 
>>>> code or arguments that deal with v3 was ported, 
>>>> this again, makes the footprint much smaller. 
>>>>
>>>> The following options were ported:
>>>>    * multiple threads
>>>>    * state-directory-path option
>>>>    * junction support (not tested)
>>>>
>>>> The rest of the mountd options were v3 only options.
>>>>
>>>> V2:
>>>>  * Added two systemd services: nfsv4-exportd and nfsv4-server
>>>>  * nfsv4-server starts rpc.nfsd -N 3, so nfs.conf mod not needed.
>>>
>>> We really shouldn't make users change how they do things.
>> If they only want v4 support...  I'm thinking is a lot easier to
>> simple do a nfsv4.server start verse edit config files.
>>
>>>
>>> Whatever we do, "systemctl start nfs-server" should still be how they
>>> start the NFS server.
>> Again.. if they install the nfsv4-utils verse the nfs-utils package
>> they should expect change... IMHO..
> 
> I would prefer having a single nfs-utils package. I don't see
> a need for a proliferation of these extra little programs --
> let's just make the usual suspects behave better.
nfs-utils is not going anywhere!! :-)

I'm just trying to give people the option of only
install a v4 client or v4 server. If they want it
all... nfs-utils will be there!!

steved.


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-03 21:22       ` Steve Dickson
@ 2021-03-03 21:54         ` J. Bruce Fields
  2021-03-03 22:07           ` Steve Dickson
  2021-03-04 13:42           ` Steve Dickson
  0 siblings, 2 replies; 34+ messages in thread
From: J. Bruce Fields @ 2021-03-03 21:54 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing list

On Wed, Mar 03, 2021 at 04:22:28PM -0500, Steve Dickson wrote:
> Hey!
> 
> On 3/3/21 10:23 AM, J. Bruce Fields wrote:
> > On Tue, Mar 02, 2021 at 05:33:23PM -0500, Steve Dickson wrote:
> >>
> >>
> >> On 2/24/21 3:30 PM, J. Bruce Fields wrote:
> >>> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
> >>>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
> >>>> The idea is to allow distros to build a v4 only package
> >>>> which will have a much smaller footprint than the
> >>>> entire nfs-utils package.
> >>>>
> >>>> exportd uses no RPC code, which means none of the 
> >>>> code or arguments that deal with v3 was ported, 
> >>>> this again, makes the footprint much smaller. 
> >>>
> >>> How much smaller?
> >> Will a bit smaller... but a number of daemons like nfsd[cld,clddb,cldnts]
> >> need to also come a long. 
> > 
> > Could we get some numbers?
> > 
> > Looks like nfs-utils in F33 is about 1.2M:
> > 
> > $ rpm -qi nfs-utils|grep ^Size
> > Size        : 1243512
> > 
> > $ strip utils/mountd/mountd
> > $ ls -lh utils/mountd/mountd
> > -rwxrwxr-x. 1 bfields bfields 128K Mar  3 10:12 utils/mountd/mountd
> > $ strip utils/exportd/exportd
> > $ ls -lh utils/exportd/exportd
> > -rwxrwxr-x. 1 bfields bfields 106K Mar  3 10:12 utils/exportd/exportd
> > 
> > So replacing mountd by exportd saves us about 20K out of 1.2M.  Is it
> > worth it?
> In smaller foot print I guess I meant no v3 daemons, esp rpcbind. 

The rpcbind rpm is 120K installed, so if the new v4-only rpm has no
dependency on rpcbind then we save 120K.

So, for stuff needed in both v4-only and full cases, would we package
that in a common rpm that they both depend on?

--b.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-03 21:54         ` J. Bruce Fields
@ 2021-03-03 22:07           ` Steve Dickson
  2021-03-03 22:17             ` J. Bruce Fields
  2021-03-04 13:42           ` Steve Dickson
  1 sibling, 1 reply; 34+ messages in thread
From: Steve Dickson @ 2021-03-03 22:07 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux NFS Mailing list



On 3/3/21 4:54 PM, J. Bruce Fields wrote:
> On Wed, Mar 03, 2021 at 04:22:28PM -0500, Steve Dickson wrote:
>> Hey!
>>
>> On 3/3/21 10:23 AM, J. Bruce Fields wrote:
>>> On Tue, Mar 02, 2021 at 05:33:23PM -0500, Steve Dickson wrote:
>>>>
>>>>
>>>> On 2/24/21 3:30 PM, J. Bruce Fields wrote:
>>>>> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
>>>>>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
>>>>>> The idea is to allow distros to build a v4 only package
>>>>>> which will have a much smaller footprint than the
>>>>>> entire nfs-utils package.
>>>>>>
>>>>>> exportd uses no RPC code, which means none of the 
>>>>>> code or arguments that deal with v3 was ported, 
>>>>>> this again, makes the footprint much smaller. 
>>>>>
>>>>> How much smaller?
>>>> Will a bit smaller... but a number of daemons like nfsd[cld,clddb,cldnts]
>>>> need to also come a long. 
>>>
>>> Could we get some numbers?
>>>
>>> Looks like nfs-utils in F33 is about 1.2M:
>>>
>>> $ rpm -qi nfs-utils|grep ^Size
>>> Size        : 1243512
>>>
>>> $ strip utils/mountd/mountd
>>> $ ls -lh utils/mountd/mountd
>>> -rwxrwxr-x. 1 bfields bfields 128K Mar  3 10:12 utils/mountd/mountd
>>> $ strip utils/exportd/exportd
>>> $ ls -lh utils/exportd/exportd
>>> -rwxrwxr-x. 1 bfields bfields 106K Mar  3 10:12 utils/exportd/exportd
>>>
>>> So replacing mountd by exportd saves us about 20K out of 1.2M.  Is it
>>> worth it?
>> In smaller foot print I guess I meant no v3 daemons, esp rpcbind. 
> 
> The rpcbind rpm is 120K installed, so if the new v4-only rpm has no
> dependency on rpcbind then we save 120K.
I believe it is more of a functionally thing than a size thing
WRT to containers. 

> 
> So, for stuff needed in both v4-only and full cases, would we package
> that in a common rpm that they both depend on?
Well... if we want the packages to be compatible yes there would
have to be a common rpm (aka nfs.conf, nfsmount.conf, upcall stuff)
But if one only wants a client or server then they don't have
to be compatible...  

steved.


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-03 22:07           ` Steve Dickson
@ 2021-03-03 22:17             ` J. Bruce Fields
  2021-03-04 13:57               ` Steve Dickson
  0 siblings, 1 reply; 34+ messages in thread
From: J. Bruce Fields @ 2021-03-03 22:17 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing list

On Wed, Mar 03, 2021 at 05:07:56PM -0500, Steve Dickson wrote:
> 
> 
> On 3/3/21 4:54 PM, J. Bruce Fields wrote:
> > On Wed, Mar 03, 2021 at 04:22:28PM -0500, Steve Dickson wrote:
> >> Hey!
> >>
> >> On 3/3/21 10:23 AM, J. Bruce Fields wrote:
> >>> On Tue, Mar 02, 2021 at 05:33:23PM -0500, Steve Dickson wrote:
> >>>>
> >>>>
> >>>> On 2/24/21 3:30 PM, J. Bruce Fields wrote:
> >>>>> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
> >>>>>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
> >>>>>> The idea is to allow distros to build a v4 only package
> >>>>>> which will have a much smaller footprint than the
> >>>>>> entire nfs-utils package.
> >>>>>>
> >>>>>> exportd uses no RPC code, which means none of the 
> >>>>>> code or arguments that deal with v3 was ported, 
> >>>>>> this again, makes the footprint much smaller. 
> >>>>>
> >>>>> How much smaller?
> >>>> Will a bit smaller... but a number of daemons like nfsd[cld,clddb,cldnts]
> >>>> need to also come a long. 
> >>>
> >>> Could we get some numbers?
> >>>
> >>> Looks like nfs-utils in F33 is about 1.2M:
> >>>
> >>> $ rpm -qi nfs-utils|grep ^Size
> >>> Size        : 1243512
> >>>
> >>> $ strip utils/mountd/mountd
> >>> $ ls -lh utils/mountd/mountd
> >>> -rwxrwxr-x. 1 bfields bfields 128K Mar  3 10:12 utils/mountd/mountd
> >>> $ strip utils/exportd/exportd
> >>> $ ls -lh utils/exportd/exportd
> >>> -rwxrwxr-x. 1 bfields bfields 106K Mar  3 10:12 utils/exportd/exportd
> >>>
> >>> So replacing mountd by exportd saves us about 20K out of 1.2M.  Is it
> >>> worth it?
> >> In smaller foot print I guess I meant no v3 daemons, esp rpcbind. 
> > 
> > The rpcbind rpm is 120K installed, so if the new v4-only rpm has no
> > dependency on rpcbind then we save 120K.
> I believe it is more of a functionally thing than a size thing
> WRT to containers. 

OK.  But if it's not about size, then we can use "rpc.mountd -N2 -N3",
we don't need a separate daemon.

--b.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-03 15:23     ` J. Bruce Fields
  2021-03-03 21:22       ` Steve Dickson
@ 2021-03-04 13:34       ` Steve Dickson
  2021-03-04 14:24         ` J. Bruce Fields
  1 sibling, 1 reply; 34+ messages in thread
From: Steve Dickson @ 2021-03-04 13:34 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux NFS Mailing list



On 3/3/21 10:23 AM, J. Bruce Fields wrote:
> On Tue, Mar 02, 2021 at 05:33:23PM -0500, Steve Dickson wrote:
>>
>>
>> On 2/24/21 3:30 PM, J. Bruce Fields wrote:
>>> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
>>>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
>>>> The idea is to allow distros to build a v4 only package
>>>> which will have a much smaller footprint than the
>>>> entire nfs-utils package.
>>>>
>>>> exportd uses no RPC code, which means none of the 
>>>> code or arguments that deal with v3 was ported, 
>>>> this again, makes the footprint much smaller. 
>>>
>>> How much smaller?
>> Will a bit smaller... but a number of daemons like nfsd[cld,clddb,cldnts]
>> need to also come a long. 
> 
> Could we get some numbers?
> 
> Looks like nfs-utils in F33 is about 1.2M:
> 
> $ rpm -qi nfs-utils|grep ^Size
> Size        : 1243512
Here are the numbers. Remember things are still in development so
these may not be the final numbers

For the v4 only client
rpm -qi nfsv4-client-utils-2* | grep ^Size
Size        : 374573

for the v4only server:
rpm -qi nfsv4-utils-2* | grep ^Size
Size        : 942088
> 
> $ strip utils/mountd/mountd
> $ ls -lh utils/mountd/mountd
> -rwxrwxr-x. 1 bfields bfields 128K Mar  3 10:12 utils/mountd/mountd
> $ strip utils/exportd/exportd
> $ ls -lh utils/exportd/exportd
> -rwxrwxr-x. 1 bfields bfields 106K Mar  3 10:12 utils/exportd/exportd
> 
> So replacing mountd by exportd saves us about 20K out of 1.2M.  Is it
> worth it?
Looking at the numbers above... I think it is.

steved. 

> 
>>>> The following options were ported:
>>>>     * multiple threads
>>>>     * state-directory-path option
>>>>     * junction support (not tested)
>>>>
>>>> The rest of the mountd options were v3 only options.
>>>
>>> There's also --manage-gids.
>> Right... a patch was posted... 
>>
>>>
>>> If you want nfsv4-only at runtime, you can always run rpc.mountd with
>>> -N2 -N3 to turn off the MOUNT protocol support.
>> The end game is not to run mountd at all... 
>>
>>>
>>> If you don't even want v2/f3 code on your system, then you may have to
>>> do something like this, but why is that important?
>> Container friendly... Not bring in all the extra daemons v3
>> needs is a good thing... esp rpcbind. 
> 
> Looking at the output of
> $ for f in $(rpm -ql nfs-utils); do if [ -f $f ]; then ls -ls $f; fi; done|sort -n
> 
> It looks like removing statd, sm-notify, showount and their man pages
> would free about another 170K.
> 
> I think that's about how much we'd save by seperating out a separate
> documentation package.
> 
> I don't know, what sort of gains are container folks asking for?
> 
> --b.
> 
>>
>> steved.
>>
>>>
>>> --b.
>>>
>>>>
>>>> V2:
>>>>   * Added two systemd services: nfsv4-exportd and nfsv4-server
>>>>   * nfsv4-server starts rpc.nfsd -N 3, so nfs.conf mod not needed.
>>>>
>>>> V3: Changed the name from exportd to nfsv4.exportd
>>>>
>>>> V4: Added compile flag that will compile in the NFSv4 only server
>>>>
>>>> Steve Dickson (7):
>>>>   exportd: the initial shell of the v4 export support
>>>>   exportd: Moved cache upcalls routines into libexport.a
>>>>   exportd: multiple threads
>>>>   exportd/exportfs: Add the state-directory-path option
>>>>   exportd: Enabled junction support
>>>>   exportd: systemd unit files
>>>>   exportd: Added config variable to compile in the NFSv4 only server.
>>>>
>>>>  .gitignore                                |   1 +
>>>>  configure.ac                              |  14 ++
>>>>  nfs.conf                                  |   4 +
>>>>  support/export/Makefile.am                |   3 +-
>>>>  {utils/mountd => support/export}/auth.c   |   4 +-
>>>>  {utils/mountd => support/export}/cache.c  |  46 +++-
>>>>  support/export/export.h                   |  34 +++
>>>>  {utils/mountd => support/export}/fsloc.c  |   0
>>>>  {utils/mountd => support/export}/v4root.c |   0
>>>>  {utils/mountd => support/include}/fsloc.h |   0
>>>>  systemd/Makefile.am                       |   6 +
>>>>  systemd/nfs.conf.man                      |  10 +
>>>>  systemd/nfsv4-exportd.service             |  12 +
>>>>  systemd/nfsv4-server.service              |  31 +++
>>>>  utils/Makefile.am                         |   4 +
>>>>  utils/exportd/Makefile.am                 |  65 +++++
>>>>  utils/exportd/exportd.c                   | 276 ++++++++++++++++++++++
>>>>  utils/exportd/exportd.man                 |  81 +++++++
>>>>  utils/exportfs/exportfs.c                 |  21 +-
>>>>  utils/exportfs/exportfs.man               |   7 +-
>>>>  utils/mountd/Makefile.am                  |   5 +-
>>>>  21 files changed, 606 insertions(+), 18 deletions(-)
>>>>  rename {utils/mountd => support/export}/auth.c (99%)
>>>>  rename {utils/mountd => support/export}/cache.c (98%)
>>>>  create mode 100644 support/export/export.h
>>>>  rename {utils/mountd => support/export}/fsloc.c (100%)
>>>>  rename {utils/mountd => support/export}/v4root.c (100%)
>>>>  rename {utils/mountd => support/include}/fsloc.h (100%)
>>>>  create mode 100644 systemd/nfsv4-exportd.service
>>>>  create mode 100644 systemd/nfsv4-server.service
>>>>  create mode 100644 utils/exportd/Makefile.am
>>>>  create mode 100644 utils/exportd/exportd.c
>>>>  create mode 100644 utils/exportd/exportd.man
>>>>
>>>> -- 
>>>> 2.29.2
>>>
> 


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-03 21:54         ` J. Bruce Fields
  2021-03-03 22:07           ` Steve Dickson
@ 2021-03-04 13:42           ` Steve Dickson
  2021-03-04 14:01             ` J. Bruce Fields
  1 sibling, 1 reply; 34+ messages in thread
From: Steve Dickson @ 2021-03-04 13:42 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux NFS Mailing list



On 3/3/21 4:54 PM, J. Bruce Fields wrote:
> On Wed, Mar 03, 2021 at 04:22:28PM -0500, Steve Dickson wrote:
>> Hey!
>>
>> On 3/3/21 10:23 AM, J. Bruce Fields wrote:
>>> On Tue, Mar 02, 2021 at 05:33:23PM -0500, Steve Dickson wrote:
>>>>
>>>>
>>>> On 2/24/21 3:30 PM, J. Bruce Fields wrote:
>>>>> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
>>>>>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
>>>>>> The idea is to allow distros to build a v4 only package
>>>>>> which will have a much smaller footprint than the
>>>>>> entire nfs-utils package.
>>>>>>
>>>>>> exportd uses no RPC code, which means none of the 
>>>>>> code or arguments that deal with v3 was ported, 
>>>>>> this again, makes the footprint much smaller. 
>>>>>
>>>>> How much smaller?
>>>> Will a bit smaller... but a number of daemons like nfsd[cld,clddb,cldnts]
>>>> need to also come a long. 
>>>
>>> Could we get some numbers?
>>>
>>> Looks like nfs-utils in F33 is about 1.2M:
>>>
>>> $ rpm -qi nfs-utils|grep ^Size
>>> Size        : 1243512
>>>
>>> $ strip utils/mountd/mountd
>>> $ ls -lh utils/mountd/mountd
>>> -rwxrwxr-x. 1 bfields bfields 128K Mar  3 10:12 utils/mountd/mountd
>>> $ strip utils/exportd/exportd
>>> $ ls -lh utils/exportd/exportd
>>> -rwxrwxr-x. 1 bfields bfields 106K Mar  3 10:12 utils/exportd/exportd
>>>
>>> So replacing mountd by exportd saves us about 20K out of 1.2M.  Is it
>>> worth it?
>> In smaller foot print I guess I meant no v3 daemons, esp rpcbind. 
> 
> The rpcbind rpm is 120K installed, so if the new v4-only rpm has no
> dependency on rpcbind then we save 120K.
The point with rpcbind is it not going to be started which means
it not opening up listening connection that may never be used.
This has pissed of people for years! :-)

> 
> So, for stuff needed in both v4-only and full cases, would we package
> that in a common rpm that they both depend on?
I thought of this... but I was going to get both packages working
and then figure out what is common between them.

steved.

> 
> --b.
> 


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-03 22:17             ` J. Bruce Fields
@ 2021-03-04 13:57               ` Steve Dickson
  2021-03-04 14:06                 ` J. Bruce Fields
  0 siblings, 1 reply; 34+ messages in thread
From: Steve Dickson @ 2021-03-04 13:57 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux NFS Mailing list



On 3/3/21 5:17 PM, J. Bruce Fields wrote:
> On Wed, Mar 03, 2021 at 05:07:56PM -0500, Steve Dickson wrote:
>>
>>
>> On 3/3/21 4:54 PM, J. Bruce Fields wrote:
>>> On Wed, Mar 03, 2021 at 04:22:28PM -0500, Steve Dickson wrote:
>>>> Hey!
>>>>
>>>> On 3/3/21 10:23 AM, J. Bruce Fields wrote:
>>>>> On Tue, Mar 02, 2021 at 05:33:23PM -0500, Steve Dickson wrote:
>>>>>>
>>>>>>
>>>>>> On 2/24/21 3:30 PM, J. Bruce Fields wrote:
>>>>>>> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
>>>>>>>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
>>>>>>>> The idea is to allow distros to build a v4 only package
>>>>>>>> which will have a much smaller footprint than the
>>>>>>>> entire nfs-utils package.
>>>>>>>>
>>>>>>>> exportd uses no RPC code, which means none of the 
>>>>>>>> code or arguments that deal with v3 was ported, 
>>>>>>>> this again, makes the footprint much smaller. 
>>>>>>>
>>>>>>> How much smaller?
>>>>>> Will a bit smaller... but a number of daemons like nfsd[cld,clddb,cldnts]
>>>>>> need to also come a long. 
>>>>>
>>>>> Could we get some numbers?
>>>>>
>>>>> Looks like nfs-utils in F33 is about 1.2M:
>>>>>
>>>>> $ rpm -qi nfs-utils|grep ^Size
>>>>> Size        : 1243512
>>>>>
>>>>> $ strip utils/mountd/mountd
>>>>> $ ls -lh utils/mountd/mountd
>>>>> -rwxrwxr-x. 1 bfields bfields 128K Mar  3 10:12 utils/mountd/mountd
>>>>> $ strip utils/exportd/exportd
>>>>> $ ls -lh utils/exportd/exportd
>>>>> -rwxrwxr-x. 1 bfields bfields 106K Mar  3 10:12 utils/exportd/exportd
>>>>>
>>>>> So replacing mountd by exportd saves us about 20K out of 1.2M.  Is it
>>>>> worth it?
>>>> In smaller foot print I guess I meant no v3 daemons, esp rpcbind. 
>>>
>>> The rpcbind rpm is 120K installed, so if the new v4-only rpm has no
>>> dependency on rpcbind then we save 120K.
>> I believe it is more of a functionally thing than a size thing
>> WRT to containers. 
> 
> OK.  But if it's not about size, then we can use "rpc.mountd -N2 -N3",
> we don't need a separate daemon.
Personally I see this is the first step away from V3... 

So what we don't need is all that RPC code, all the different mounting
versions... no RPC code at all,  which also means no need for libtirpc... 
That is a lot of code that goes away, which I think is a good thing.

I never thought it was a good idea to have mountd process
the v4 upcalls... I always thought it should be a different
deamon... and now we have one.

A simple daemon that only processes v4 upcalls.

steved.


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-04 13:42           ` Steve Dickson
@ 2021-03-04 14:01             ` J. Bruce Fields
  2021-03-04 16:47               ` Steve Dickson
  2021-03-04 21:31               ` Patrick Goetz
  0 siblings, 2 replies; 34+ messages in thread
From: J. Bruce Fields @ 2021-03-04 14:01 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing list

On Thu, Mar 04, 2021 at 08:42:24AM -0500, Steve Dickson wrote:
> 
> 
> On 3/3/21 4:54 PM, J. Bruce Fields wrote:
> > On Wed, Mar 03, 2021 at 04:22:28PM -0500, Steve Dickson wrote:
> >> Hey!
> >>
> >> On 3/3/21 10:23 AM, J. Bruce Fields wrote:
> >>> On Tue, Mar 02, 2021 at 05:33:23PM -0500, Steve Dickson wrote:
> >>>>
> >>>>
> >>>> On 2/24/21 3:30 PM, J. Bruce Fields wrote:
> >>>>> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
> >>>>>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
> >>>>>> The idea is to allow distros to build a v4 only package
> >>>>>> which will have a much smaller footprint than the
> >>>>>> entire nfs-utils package.
> >>>>>>
> >>>>>> exportd uses no RPC code, which means none of the 
> >>>>>> code or arguments that deal with v3 was ported, 
> >>>>>> this again, makes the footprint much smaller. 
> >>>>>
> >>>>> How much smaller?
> >>>> Will a bit smaller... but a number of daemons like nfsd[cld,clddb,cldnts]
> >>>> need to also come a long. 
> >>>
> >>> Could we get some numbers?
> >>>
> >>> Looks like nfs-utils in F33 is about 1.2M:
> >>>
> >>> $ rpm -qi nfs-utils|grep ^Size
> >>> Size        : 1243512
> >>>
> >>> $ strip utils/mountd/mountd
> >>> $ ls -lh utils/mountd/mountd
> >>> -rwxrwxr-x. 1 bfields bfields 128K Mar  3 10:12 utils/mountd/mountd
> >>> $ strip utils/exportd/exportd
> >>> $ ls -lh utils/exportd/exportd
> >>> -rwxrwxr-x. 1 bfields bfields 106K Mar  3 10:12 utils/exportd/exportd
> >>>
> >>> So replacing mountd by exportd saves us about 20K out of 1.2M.  Is it
> >>> worth it?
> >> In smaller foot print I guess I meant no v3 daemons, esp rpcbind. 
> > 
> > The rpcbind rpm is 120K installed, so if the new v4-only rpm has no
> > dependency on rpcbind then we save 120K.
> The point with rpcbind is it not going to be started which means
> it not opening up listening connection that may never be used.
> This has pissed of people for years! :-)

OK, but we can do that without replacing mountd and changing the way
everyone installs nfs-utils and runs the nfs server.

--b.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-04 13:57               ` Steve Dickson
@ 2021-03-04 14:06                 ` J. Bruce Fields
  2021-03-04 16:31                   ` Steve Dickson
  0 siblings, 1 reply; 34+ messages in thread
From: J. Bruce Fields @ 2021-03-04 14:06 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing list

On Thu, Mar 04, 2021 at 08:57:28AM -0500, Steve Dickson wrote:
> Personally I see this is the first step away from V3... 
> 
> So what we don't need is all that RPC code, all the different mounting
> versions... no RPC code at all,  which also means no need for libtirpc... 
> That is a lot of code that goes away, which I think is a good thing.

libtirpc is a shared library, it'll still be loaded as long as anyone
needs it, and I'm not convinced we'll be able to get rid of all users.

> I never thought it was a good idea to have mountd process
> the v4 upcalls... I always thought it should be a different
> deamon... and now we have one.
> 
> A simple daemon that only processes v4 upcalls.

I really do get the appeal, I've always liked the idea too.

I'm not sure it's bringing us a real practical advantage at this point,
compared to rpc.mountd, which can act either as a daemon that only
processes v4 upcalls or can do both, depending on how you start it.

--b.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-04 13:34       ` Steve Dickson
@ 2021-03-04 14:24         ` J. Bruce Fields
  2021-03-04 16:20           ` Steve Dickson
  0 siblings, 1 reply; 34+ messages in thread
From: J. Bruce Fields @ 2021-03-04 14:24 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing list

On Thu, Mar 04, 2021 at 08:34:45AM -0500, Steve Dickson wrote:
> 
> 
> On 3/3/21 10:23 AM, J. Bruce Fields wrote:
> > On Tue, Mar 02, 2021 at 05:33:23PM -0500, Steve Dickson wrote:
> >>
> >>
> >> On 2/24/21 3:30 PM, J. Bruce Fields wrote:
> >>> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
> >>>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
> >>>> The idea is to allow distros to build a v4 only package
> >>>> which will have a much smaller footprint than the
> >>>> entire nfs-utils package.
> >>>>
> >>>> exportd uses no RPC code, which means none of the 
> >>>> code or arguments that deal with v3 was ported, 
> >>>> this again, makes the footprint much smaller. 
> >>>
> >>> How much smaller?
> >> Will a bit smaller... but a number of daemons like nfsd[cld,clddb,cldnts]
> >> need to also come a long. 
> > 
> > Could we get some numbers?
> > 
> > Looks like nfs-utils in F33 is about 1.2M:
> > 
> > $ rpm -qi nfs-utils|grep ^Size
> > Size        : 1243512
> Here are the numbers. Remember things are still in development so
> these may not be the final numbers
> 
> For the v4 only client
> rpm -qi nfsv4-client-utils-2* | grep ^Size
> Size        : 374573
> 
> for the v4only server:
> rpm -qi nfsv4-utils-2* | grep ^Size
> Size        : 942088

$ rpm -qi nfs-utils|grep ^Size
Size        : 1243512
$ echo $((374573+942088))
1316661

So, they're a little bigger than nfs-utils, taken together.  Like you
say, under development, probably there's just something overlooked that
could be removed from one or the other or moved to an nfs-common
package.

That might make a case for splitting up client and server sides for
minimal installs that need only one or the other.

If it's installed size we're working on, though, do we have some target
in mind here, though?  Do we know what the container people are aiming
for?  I had some idea glic is more in the 10s of megabytes, and a
minimal Fedora install is in the 100s, so I just wonder if it's worth
chasing after 10s-100s of K.

--b.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-04 14:24         ` J. Bruce Fields
@ 2021-03-04 16:20           ` Steve Dickson
  0 siblings, 0 replies; 34+ messages in thread
From: Steve Dickson @ 2021-03-04 16:20 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux NFS Mailing list



On 3/4/21 9:24 AM, J. Bruce Fields wrote:
> On Thu, Mar 04, 2021 at 08:34:45AM -0500, Steve Dickson wrote:
>>
>>
>> On 3/3/21 10:23 AM, J. Bruce Fields wrote:
>>> On Tue, Mar 02, 2021 at 05:33:23PM -0500, Steve Dickson wrote:
>>>>
>>>>
>>>> On 2/24/21 3:30 PM, J. Bruce Fields wrote:
>>>>> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
>>>>>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
>>>>>> The idea is to allow distros to build a v4 only package
>>>>>> which will have a much smaller footprint than the
>>>>>> entire nfs-utils package.
>>>>>>
>>>>>> exportd uses no RPC code, which means none of the 
>>>>>> code or arguments that deal with v3 was ported, 
>>>>>> this again, makes the footprint much smaller. 
>>>>>
>>>>> How much smaller?
>>>> Will a bit smaller... but a number of daemons like nfsd[cld,clddb,cldnts]
>>>> need to also come a long. 
>>>
>>> Could we get some numbers?
>>>
>>> Looks like nfs-utils in F33 is about 1.2M:
>>>
>>> $ rpm -qi nfs-utils|grep ^Size
>>> Size        : 1243512
>> Here are the numbers. Remember things are still in development so
>> these may not be the final numbers
>>
>> For the v4 only client
>> rpm -qi nfsv4-client-utils-2* | grep ^Size
>> Size        : 374573
>>
>> for the v4only server:
>> rpm -qi nfsv4-utils-2* | grep ^Size
>> Size        : 942088
> 
> $ rpm -qi nfs-utils|grep ^Size
> Size        : 1243512
> $ echo $((374573+942088))
> 1316661
> 
> So, they're a little bigger than nfs-utils, taken together.  Like you
> say, under development, probably there's just something overlooked that
> could be removed from one or the other or moved to an nfs-common
> package.
With containers in mind, I was thinking it would be one or the other
not both. I can see a container only wanting an client or server
but not both.

> 
> That might make a case for splitting up client and server sides for
> minimal installs that need only one or the other.
> 
> If it's installed size we're working on, though, do we have some target
> in mind here, though?  
No. 

Do we know what the container people are aiming for?  
No. I'm sure they don't know this is going on.

> I had some idea glic is more in the 10s of megabytes, and a
> minimal Fedora install is in the 100s, so I just wonder if it's worth
> chasing after 10s-100s of K.
I really don't think we need a target size... The size 
will be smaller because how the packages are broken up. 
Installing one of the v4 packages will always have 
smaller footprint than the entire nfs-utils package.

steved.
> 
> --b.
> 


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-04 14:06                 ` J. Bruce Fields
@ 2021-03-04 16:31                   ` Steve Dickson
  2021-03-05 14:36                     ` J. Bruce Fields
  0 siblings, 1 reply; 34+ messages in thread
From: Steve Dickson @ 2021-03-04 16:31 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux NFS Mailing list



On 3/4/21 9:06 AM, J. Bruce Fields wrote:
> On Thu, Mar 04, 2021 at 08:57:28AM -0500, Steve Dickson wrote:
>> Personally I see this is the first step away from V3... 
>>
>> So what we don't need is all that RPC code, all the different mounting
>> versions... no RPC code at all,  which also means no need for libtirpc... 
>> That is a lot of code that goes away, which I think is a good thing.
> 
> libtirpc is a shared library, it'll still be loaded as long as anyone
> needs it, and I'm not convinced we'll be able to get rid of all users.
> 
>> I never thought it was a good idea to have mountd process
>> the v4 upcalls... I always thought it should be a different
>> deamon... and now we have one.
>>
>> A simple daemon that only processes v4 upcalls.
> 
> I really do get the appeal, I've always liked the idea too.
> 
> I'm not sure it's bringing us a real practical advantage at this point,
> compared to rpc.mountd, which can act either as a daemon that only
> processes v4 upcalls or can do both, depending on how you start it.
Right with some configuration changes... But I do think there is 
value with have a package that will work right out of the box!

Boom! Install the package and you have a working v4 server
with no configure changes... I do think there is value there.

steved.


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-04 14:01             ` J. Bruce Fields
@ 2021-03-04 16:47               ` Steve Dickson
  2021-03-04 21:31               ` Patrick Goetz
  1 sibling, 0 replies; 34+ messages in thread
From: Steve Dickson @ 2021-03-04 16:47 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux NFS Mailing list



On 3/4/21 9:01 AM, J. Bruce Fields wrote:
> On Thu, Mar 04, 2021 at 08:42:24AM -0500, Steve Dickson wrote:
>>
>>
>> On 3/3/21 4:54 PM, J. Bruce Fields wrote:
>>> On Wed, Mar 03, 2021 at 04:22:28PM -0500, Steve Dickson wrote:
>>>> Hey!
>>>>
>>>> On 3/3/21 10:23 AM, J. Bruce Fields wrote:
>>>>> On Tue, Mar 02, 2021 at 05:33:23PM -0500, Steve Dickson wrote:
>>>>>>
>>>>>>
>>>>>> On 2/24/21 3:30 PM, J. Bruce Fields wrote:
>>>>>>> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
>>>>>>>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
>>>>>>>> The idea is to allow distros to build a v4 only package
>>>>>>>> which will have a much smaller footprint than the
>>>>>>>> entire nfs-utils package.
>>>>>>>>
>>>>>>>> exportd uses no RPC code, which means none of the 
>>>>>>>> code or arguments that deal with v3 was ported, 
>>>>>>>> this again, makes the footprint much smaller. 
>>>>>>>
>>>>>>> How much smaller?
>>>>>> Will a bit smaller... but a number of daemons like nfsd[cld,clddb,cldnts]
>>>>>> need to also come a long. 
>>>>>
>>>>> Could we get some numbers?
>>>>>
>>>>> Looks like nfs-utils in F33 is about 1.2M:
>>>>>
>>>>> $ rpm -qi nfs-utils|grep ^Size
>>>>> Size        : 1243512
>>>>>
>>>>> $ strip utils/mountd/mountd
>>>>> $ ls -lh utils/mountd/mountd
>>>>> -rwxrwxr-x. 1 bfields bfields 128K Mar  3 10:12 utils/mountd/mountd
>>>>> $ strip utils/exportd/exportd
>>>>> $ ls -lh utils/exportd/exportd
>>>>> -rwxrwxr-x. 1 bfields bfields 106K Mar  3 10:12 utils/exportd/exportd
>>>>>
>>>>> So replacing mountd by exportd saves us about 20K out of 1.2M.  Is it
>>>>> worth it?
>>>> In smaller foot print I guess I meant no v3 daemons, esp rpcbind. 
>>>
>>> The rpcbind rpm is 120K installed, so if the new v4-only rpm has no
>>> dependency on rpcbind then we save 120K.
>> The point with rpcbind is it not going to be started which means
>> it not opening up listening connection that may never be used.
>> This has pissed of people for years! :-)
> 
> OK, but we can do that without replacing mountd and changing the way
> everyone installs nfs-utils and runs the nfs server.
I'm not replacing mounts in nfs-utils and I not changing how the
server is started in nfs-utils... I'm just  giving people options

If you want this particular function install this package
If you want that particular function install that package
If you want the entire kit and caboodle use this package. 

Since these new package will have different names things
will work slightly different, but that all will be using
the same code base. 

steved.
  
> 
> --b.
> 


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH] exportd: server-side gid management
  2021-02-23 16:13   ` [PATCH] exportd: server-side gid management Daniel Kobras
@ 2021-03-04 21:28     ` Steve Dickson
  0 siblings, 0 replies; 34+ messages in thread
From: Steve Dickson @ 2021-03-04 21:28 UTC (permalink / raw)
  To: Daniel Kobras; +Cc: Linux NFS Mailing list



On 2/23/21 11:13 AM, Daniel Kobras wrote:
> Ported manage-gids option from mountd
> 
> Signed-off-by: Daniel Kobras <kobras@puzzle-itc.de>
Committed... Thanks!

steved.
> ---
> Hi Steve!
> 
> Option --manage-gids should still be useful with NFSv4 and AUTH_SYS, but 
> commit 15dc0bead10d20c31e72ca94ce21eb66dc3528d5 does not allow to actually
> control the global variable manage_gids from exportd. I assume something
> like the following was intended?
> 
> Kind regards,
> 
> Daniel
> 
>  nfs.conf                  |  1 +
>  utils/exportd/exportd.c   |  8 +++++++-
>  utils/exportd/exportd.man | 16 ++++++++++++++++
>  3 files changed, 24 insertions(+), 1 deletion(-)
> 
> diff --git a/nfs.conf b/nfs.conf
> index bebb2e3d..e69ec16d 100644
> --- a/nfs.conf
> +++ b/nfs.conf
> @@ -31,6 +31,7 @@
>  #
>  [exportd]
>  # debug="all|auth|call|general|parse"
> +# manage-gids=n
>  # state-directory-path=/var/lib/nfs
>  # threads=1
>  [mountd]
> diff --git a/utils/exportd/exportd.c b/utils/exportd/exportd.c
> index 7130bcbf..0d7782be 100644
> --- a/utils/exportd/exportd.c
> +++ b/utils/exportd/exportd.c
> @@ -42,6 +42,7 @@ static struct option longopts[] =
>  	{ "foreground", 0, 0, 'F' },
>  	{ "debug", 1, 0, 'd' },
>  	{ "help", 0, 0, 'h' },
> +	{ "manage-gids", 0, 0, 'g' },
>  	{ "num-threads", 1, 0, 't' },
>  	{ NULL, 0, 0, 0 }
>  };
> @@ -174,6 +175,7 @@ usage(const char *prog, int n)
>  {
>  	fprintf(stderr,
>  		"Usage: %s [-f|--foreground] [-h|--help] [-d kind|--debug kind]\n"
> +"	[-g|--manage-gids]\n"
>  "	[-s|--state-directory-path path]\n"
>  "	[-t num|--num-threads=num]\n", prog);
>  	exit(n);
> @@ -188,6 +190,7 @@ read_exportd_conf(char *progname, char **argv)
>  
>  	xlog_set_debug(progname);
>  
> +	manage_gids = conf_get_bool("exportd", "manage-gids", manage_gids);
>  	num_threads = conf_get_num("exportd", "threads", num_threads);
>  
>  	s = conf_get_str("exportd", "state-directory-path");
> @@ -214,7 +217,7 @@ main(int argc, char **argv)
>  	/* Read in config setting */
>  	read_exportd_conf(progname, argv);
>  
> -	while ((c = getopt_long(argc, argv, "d:fhs:t:", longopts, NULL)) != EOF) {
> +	while ((c = getopt_long(argc, argv, "d:fghs:t:", longopts, NULL)) != EOF) {
>  		switch (c) {
>  		case 'd':
>  			xlog_sconfig(optarg, 1);
> @@ -222,6 +225,9 @@ main(int argc, char **argv)
>  		case 'f':
>  			foreground++;
>  			break;
> +		case 'g':
> +			manage_gids = 1;
> +			break;
>  		case 'h':
>  			usage(progname, 0);
>  			break;
> diff --git a/utils/exportd/exportd.man b/utils/exportd/exportd.man
> index 1d65b5e0..d7884562 100644
> --- a/utils/exportd/exportd.man
> +++ b/utils/exportd/exportd.man
> @@ -51,6 +51,21 @@ spawns.  The default is 1 thread, which is probably enough.  More
>  threads are usually only needed for NFS servers which need to handle
>  mount storms of hundreds of NFS mounts in a few seconds, or when
>  your DNS server is slow or unreliable.
> +.TP
> +.BR \-g " or " \-\-manage-gids
> +Accept requests from the kernel to map user id numbers into lists of
> +group id numbers for use in access control.  An NFS request will
> +normally (except when using Kerberos or other cryptographic
> +authentication) contain a user-id and a list of group-ids.  Due to a
> +limitation in the NFS protocol, at most 16 groups ids can be listed.
> +If you use the
> +.B \-g
> +flag, then the list of group ids received from the client will be
> +replaced by a list of group ids determined by an appropriate lookup on
> +the server. Note that the 'primary' group id is not affected so a
> +.B newgroup
> +command on the client will still be effective.  This function requires
> +a Linux Kernel with version at least 2.6.21.
>  .SH CONFIGURATION FILE
>  Many of the options that can be set on the command line can also be
>  controlled through values set in the
> @@ -63,6 +78,7 @@ configuration file.
>  Values recognized in the
>  .B [exportd]
>  section include 
> +.BR manage-gids ", and"
>  .B debug 
>  which each have the same effect as the option with the same name.
>  .SH FILES
> 


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-04 14:01             ` J. Bruce Fields
  2021-03-04 16:47               ` Steve Dickson
@ 2021-03-04 21:31               ` Patrick Goetz
  1 sibling, 0 replies; 34+ messages in thread
From: Patrick Goetz @ 2021-03-04 21:31 UTC (permalink / raw)
  To: Linux NFS Mailing list



On 3/4/21 8:01 AM, J. Bruce Fields wrote:
> On Thu, Mar 04, 2021 at 08:42:24AM -0500, Steve Dickson wrote:
>>
>>
>> On 3/3/21 4:54 PM, J. Bruce Fields wrote:
>>> On Wed, Mar 03, 2021 at 04:22:28PM -0500, Steve Dickson wrote:
>>>> Hey!
>>>>
>>>> On 3/3/21 10:23 AM, J. Bruce Fields wrote:
>>>>> On Tue, Mar 02, 2021 at 05:33:23PM -0500, Steve Dickson wrote:
>>>>>>
>>>>>>
>>>>>> On 2/24/21 3:30 PM, J. Bruce Fields wrote:
>>>>>>> On Fri, Feb 19, 2021 at 03:08:08PM -0500, Steve Dickson wrote:
>>>>>>>> nfsv4.exportd is a daemon that will listen for only v4 mount upcalls.
>>>>>>>> The idea is to allow distros to build a v4 only package
>>>>>>>> which will have a much smaller footprint than the
>>>>>>>> entire nfs-utils package.
>>>>>>>>
>>>>>>>> exportd uses no RPC code, which means none of the
>>>>>>>> code or arguments that deal with v3 was ported,
>>>>>>>> this again, makes the footprint much smaller.
>>>>>>>
>>>>>>> How much smaller?
>>>>>> Will a bit smaller... but a number of daemons like nfsd[cld,clddb,cldnts]
>>>>>> need to also come a long.
>>>>>
>>>>> Could we get some numbers?
>>>>>
>>>>> Looks like nfs-utils in F33 is about 1.2M:
>>>>>
>>>>> $ rpm -qi nfs-utils|grep ^Size
>>>>> Size        : 1243512
>>>>>
>>>>> $ strip utils/mountd/mountd
>>>>> $ ls -lh utils/mountd/mountd
>>>>> -rwxrwxr-x. 1 bfields bfields 128K Mar  3 10:12 utils/mountd/mountd
>>>>> $ strip utils/exportd/exportd
>>>>> $ ls -lh utils/exportd/exportd
>>>>> -rwxrwxr-x. 1 bfields bfields 106K Mar  3 10:12 utils/exportd/exportd
>>>>>
>>>>> So replacing mountd by exportd saves us about 20K out of 1.2M.  Is it
>>>>> worth it?
>>>> In smaller foot print I guess I meant no v3 daemons, esp rpcbind.
>>>
>>> The rpcbind rpm is 120K installed, so if the new v4-only rpm has no
>>> dependency on rpcbind then we save 120K.
>> The point with rpcbind is it not going to be started which means
>> it not opening up listening connection that may never be used.
>> This has pissed of people for years! :-)
> 
> OK, but we can do that without replacing mountd and changing the way
> everyone installs nfs-utils and runs the nfs server.
> 
 >
 > --b.
 >

Yes, but then people get involved. The announcement of exportd was the 
tech highlight of my week. It's not about the size, it's about how 
distros package the tools, documentation, and configuration complexity. 
Taking these one at a time:

If it were up to me, everyone would run Arch linux with NFS systemd 
service files I wrote myself. These service files would pretend that NFS 
v.3 was long forgotten. Unfortunately, I work in a large organization 
with other people and don't get to make those calls. We run Ubuntu and 
RHEL/CentOS, and the systemd service files are configured to launch 
rpcbind as a dependent service. That's a problem because the local 
Information Security Office sees rpcbind as a dangerous cancer and will 
automatically quarantine any machine advertising this service. I've 
worked through the spaghetti ensemble of service units provided by 
Canonical which launch NFS services in order to attempt to undo the 
rpcbind dependency, but it's a pain in the ass. If NFS v.3 isn't an 
option, the distro supplied service files will necessarily be required 
to behave, too.

If the NFS documentation were superlative, this might be less of a 
problem, but the current instantiation of NFS is saddled with decades of 
technical debt, out of date documentation and some new features aren't 
even documented (we've even discussed this on this list). I'm still 
trying to figure out how people know how to set up pNFS, for example. 
NFS v4 is sufficiently different from v3 that the preponderance of old 
information on the Internet is confusing and contradictory. If the 
daemon name is different, that's an immediate and obvious tip off that 
you're looking at out of date information. The people referencing 
exportd are the ones to pay attention to.

Looking at one of my Ubuntu 18.04 server installs, there's configuration 
information in the systemd unit files, there's configuration information 
in /etc/default, and elsewhere. If I set

   RPCMOUNTDOPTS="--manage-gids -N 2 -N 3 -u"

in /etc/default/nfs-kernel-server, does that actually do anything?  Who 
knows? (Actually, if you dig through everything related in 
/lib/systemd/system, it does at least read this file.) Runing tcpdump 
and tracing the packets should not be the solution to every 
configuration question. Any simplification of this is welcome, even if 
the resulting code is 128K *larger*.

Also, I'm guessing NFS would see wider adoption if there were a 
simplified v.4 only packaging option. Just sayin'.


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-04 16:31                   ` Steve Dickson
@ 2021-03-05 14:36                     ` J. Bruce Fields
  2021-03-05 15:53                       ` Chuck Lever
  0 siblings, 1 reply; 34+ messages in thread
From: J. Bruce Fields @ 2021-03-05 14:36 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing list

On Thu, Mar 04, 2021 at 11:31:53AM -0500, Steve Dickson wrote:
> 
> 
> On 3/4/21 9:06 AM, J. Bruce Fields wrote:
> > On Thu, Mar 04, 2021 at 08:57:28AM -0500, Steve Dickson wrote:
> >> Personally I see this is the first step away from V3... 
> >>
> >> So what we don't need is all that RPC code, all the different mounting
> >> versions... no RPC code at all,  which also means no need for libtirpc... 
> >> That is a lot of code that goes away, which I think is a good thing.
> > 
> > libtirpc is a shared library, it'll still be loaded as long as anyone
> > needs it, and I'm not convinced we'll be able to get rid of all users.
> > 
> >> I never thought it was a good idea to have mountd process
> >> the v4 upcalls... I always thought it should be a different
> >> deamon... and now we have one.
> >>
> >> A simple daemon that only processes v4 upcalls.
> > 
> > I really do get the appeal, I've always liked the idea too.
> > 
> > I'm not sure it's bringing us a real practical advantage at this point,
> > compared to rpc.mountd, which can act either as a daemon that only
> > processes v4 upcalls or can do both, depending on how you start it.
> Right with some configuration changes... But I do think there is 
> value with have a package that will work right out of the box!
> 
> Boom! Install the package and you have a working v4 server
> with no configure changes... I do think there is value there.

Installing rpms and enabling systemd units is also a form of
configuration.

So maybe it comes down to whether we'd rather configure a v4-only server
with:

	dnf install nfsv4-only-server
	systemctl enable nfsv4-server

vs.

	edit some stuff in /etc/nfs.conf

My preference is for the second, but it's just a feeling, I don't really
have an objective argument either way.  Anyone else?

--b.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 0/7 V4] The NFSv4 only mounting daemon.
  2021-03-05 14:36                     ` J. Bruce Fields
@ 2021-03-05 15:53                       ` Chuck Lever
  0 siblings, 0 replies; 34+ messages in thread
From: Chuck Lever @ 2021-03-05 15:53 UTC (permalink / raw)
  To: Bruce Fields, Steve Dickson; +Cc: Linux NFS Mailing List



> On Mar 5, 2021, at 9:36 AM, J. Bruce Fields <bfields@fieldses.org> wrote:
> 
> On Thu, Mar 04, 2021 at 11:31:53AM -0500, Steve Dickson wrote:
>> 
>> 
>> On 3/4/21 9:06 AM, J. Bruce Fields wrote:
>>> On Thu, Mar 04, 2021 at 08:57:28AM -0500, Steve Dickson wrote:
>>>> Personally I see this is the first step away from V3... 
>>>> 
>>>> So what we don't need is all that RPC code, all the different mounting
>>>> versions... no RPC code at all,  which also means no need for libtirpc... 
>>>> That is a lot of code that goes away, which I think is a good thing.
>>> 
>>> libtirpc is a shared library, it'll still be loaded as long as anyone
>>> needs it, and I'm not convinced we'll be able to get rid of all users.
>>> 
>>>> I never thought it was a good idea to have mountd process
>>>> the v4 upcalls... I always thought it should be a different
>>>> deamon... and now we have one.
>>>> 
>>>> A simple daemon that only processes v4 upcalls.
>>> 
>>> I really do get the appeal, I've always liked the idea too.
>>> 
>>> I'm not sure it's bringing us a real practical advantage at this point,
>>> compared to rpc.mountd, which can act either as a daemon that only
>>> processes v4 upcalls or can do both, depending on how you start it.
>> Right with some configuration changes... But I do think there is 
>> value with have a package that will work right out of the box!

I didn't understand this claim. Don't we already have that?
If not, why not?


>> Boom! Install the package and you have a working v4 server
>> with no configure changes... I do think there is value there.
> 
> Installing rpms and enabling systemd units is also a form of
> configuration.

Don't understand this argument either. What does "with no
configuration changes" mean exactly? Installing and enabling
is, as Bruce says, about the same administrative hassle as
editing /etc/nfs.conf. What's being avoided here?


> So maybe it comes down to whether we'd rather configure a v4-only server
> with:
> 
> 	dnf install nfsv4-only-server
> 	systemctl enable nfsv4-server
> 
> vs.
> 
> 	edit some stuff in /etc/nfs.conf
> 
> My preference is for the second, but it's just a feeling, I don't really
> have an objective argument either way.  Anyone else?

Now, I'm making these comments in good faith. I don't want
Steve to roll his eyes and think "what a pain in the ass".
Please read and digest. Maybe have a Scotch and get a good
night's sleep before replying. I really really don't want
an argument, especially not right before a weekend. (And
note please that I've given some alternatives here, so I'm
not just trying to knock down the ideas).


I feel strongly that the first approach is wrong, but it's
Steve's ballgame so I'm not going to go as far as a NAK.

We've spent a decade trying to fix the mistake of having an
"nfs" and "nfs4" filesystem type on the client. Now we want
to do the same thing on the server, and in the end, if and
when NFSv3 goes away, we will be stuck with nfsv4-only-server.
All I'm saying is we should proceed very carefully so we
don't paint ourselves into a corner in the long run. This
game is ultimately about lowering long-term maintenance cost.

First, if only NFSv4 is configured in /etc/nfs.conf, then
just don't start rpcbind. We already do this for statd when
NFSv2 or NFSv3 is mounted on an NFS client. Let's automate
and hide as much complexity as possible.

Second, "dnf install nfsv4-only-server" by itself makes sense
if you want to remove rpcbind and a few other components that
are not ever going to be used, and you want to prevent dnf
from ever installing them again during an update.

But instead of nfsv4-only-server I might consider splitting
the RPM generated by nfs-utils.src: one called nfs4-utils
that installs the nfsv4-only stuff, and nfs-utils, which
depends on nfs4-utils and installs the non-v4 stuff too. No
changes to systemd units, please! And "dnf install nfs-utils"
as before still provides the whole user space suite.

Folks who just want an NFSv4 server can uninstall nfs-utils
and install nfs4-utils (or if nothing is on the system, just
install nfs4-utils). The configuration steps, and this is
critical, are otherwise exactly the same in both cases.

Third, as for exportd... if we're not changing the upcall
mechanism, then just having mountd not start network listeners
seems entirely adequate. I don't see the sense in replacing
it.

If you want smaller binaries, then let's focus on putting
the whole nfs-utils package on a diet. Everyone wins that
way.

--
Chuck Lever




^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2021-03-05 15:55 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-19 20:08 [PATCH 0/7 V4] The NFSv4 only mounting daemon Steve Dickson
2021-02-19 20:08 ` [PATCH 1/7] exportd: the initial shell of the v4 export support Steve Dickson
2021-02-19 20:08 ` [PATCH 2/7] exportd: Moved cache upcalls routines into libexport.a Steve Dickson
2021-02-23 16:13   ` [PATCH] exportd: server-side gid management Daniel Kobras
2021-03-04 21:28     ` Steve Dickson
2021-02-19 20:08 ` [PATCH 3/7] exportd: multiple threads Steve Dickson
2021-02-19 20:08 ` [PATCH 4/7] exportd/exportfs: Add the state-directory-path option Steve Dickson
2021-02-19 20:08 ` [PATCH 5/7] exportd: Enabled junction support Steve Dickson
2021-02-19 20:08 ` [PATCH 6/7] exportd: systemd unit files Steve Dickson
2021-02-19 20:08 ` [PATCH 7/7] exportd: Added config variable to compile in the NFSv4 only server Steve Dickson
2021-02-20 16:33 ` [PATCH 0/7 V4] The NFSv4 only mounting daemon Steve Dickson
2021-02-24 20:30 ` J. Bruce Fields
2021-03-02 22:33   ` Steve Dickson
2021-03-03 15:23     ` J. Bruce Fields
2021-03-03 21:22       ` Steve Dickson
2021-03-03 21:54         ` J. Bruce Fields
2021-03-03 22:07           ` Steve Dickson
2021-03-03 22:17             ` J. Bruce Fields
2021-03-04 13:57               ` Steve Dickson
2021-03-04 14:06                 ` J. Bruce Fields
2021-03-04 16:31                   ` Steve Dickson
2021-03-05 14:36                     ` J. Bruce Fields
2021-03-05 15:53                       ` Chuck Lever
2021-03-04 13:42           ` Steve Dickson
2021-03-04 14:01             ` J. Bruce Fields
2021-03-04 16:47               ` Steve Dickson
2021-03-04 21:31               ` Patrick Goetz
2021-03-04 13:34       ` Steve Dickson
2021-03-04 14:24         ` J. Bruce Fields
2021-03-04 16:20           ` Steve Dickson
2021-02-24 20:49 ` J. Bruce Fields
2021-03-02 22:39   ` Steve Dickson
2021-03-03 18:10     ` Chuck Lever
2021-03-03 21:24       ` Steve Dickson

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).