From a3ba86df7945e50e6cfadf8ee5acf9d30728632e Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Mon, 28 Nov 2022 10:08:16 -0500 Subject: [PATCH] Updated to the latest RC release: nfs-utils-2-6-3-rc4 (bz 2144605) Remove old nfsconvert dependencies (bz 2144179) Signed-off-by: Steve Dickson --- ...6.3-rc3.patch => nfs-utils.2.6.3-rc4.patch | 276 ++++++++++++++++-- nfs-utils.spec | 12 +- 2 files changed, 265 insertions(+), 23 deletions(-) rename nfs-utils.2.6.3-rc3.patch => nfs-utils.2.6.3-rc4.patch (56%) diff --git a/nfs-utils.2.6.3-rc3.patch b/nfs-utils.2.6.3-rc4.patch similarity index 56% rename from nfs-utils.2.6.3-rc3.patch rename to nfs-utils.2.6.3-rc4.patch index 11b4270..cd098d1 100644 --- a/nfs-utils.2.6.3-rc3.patch +++ b/nfs-utils.2.6.3-rc4.patch @@ -1,5 +1,79 @@ +diff --git a/.gitignore b/.gitignore +index df791a83..682153d5 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -86,3 +86,5 @@ systemd/rpc-gssd.service + cscope.* + # generic editor backup et al + *~ ++# file generated by ctags ++tags +diff --git a/README b/README +index 5e982409..3b0e771f 100644 +--- a/README ++++ b/README +@@ -25,7 +25,7 @@ Unpack the sources and run these commands: + # ./configure + # make + +-To install binaries and documenation, run this command: ++To install binaries and documentation, run this command: + + # make install + +@@ -40,7 +40,7 @@ Updating to the latest head after you've already got it. + + git pull + +-Building requires that autotools be installed. To invoke them ++Building requires that autotools be installed. To invoke them + simply + + sh autogen.sh +@@ -70,7 +70,7 @@ scripts can be written to work correctly. + 3.1. SERVER STARTUP + + +- A/ mount -t nfsd /proc/fs/nfsd ++ A/ mount -t nfsd nfsd /proc/fs/nfsd + This filesystem needs to be mount before most daemons, + particularly exportfs, mountd, svcgssd, idmapd. + It could be mounted once, or the script that starts each daemon +@@ -95,27 +95,27 @@ scripts can be written to work correctly. + + D/ rpc.statd --no-notify + It is best if statd is started before nfsd though this isn't +- critical. Certainly it should be at most a few seconds after ++ critical. Certainly, it should be at most a few seconds after + nfsd. + When nfsd starts it will start lockd. If lockd then receives a +- lock request it will communicate with statd. If statd is not ++ lock request, it will communicate with statd. If statd is not + running lockd will retry, but it won't wait forever for a + reply. + Note that if statd is started before nfsd, the --no-notify +- option must be used. If notify requests are sent out before ++ option must be used. If notify requests are sent out before + nfsd start, clients may try to reclaim locks and, on finding + that lockd isn't running, they will give up and never reclaim + the lock. + rpc.statd is only needed for NFSv2 and NFSv3 support. + + E/ rpc.nfsd +- Starting nfsd will automatically start lockd. The nfs server ++ Starting nfsd will automatically start lockd. The nfs server + will now be fully active and respond to any requests from + clients. + + F/ sm-notify + This will notify any client which might have locks from before +- a reboot to try to reclaim their locks. This should start ++ a reboot to try to reclaim their locks. This should start + immediately after rpc.nfsd is started so that clients have a + chance to reclaim locks within the 90 second grace period. + sm-notify is only needed for NFSv2 and NFSv3 support. diff --git a/configure.ac b/configure.ac -index f1c46c5..5d9cbf3 100644 +index f1c46c5c..5d9cbf31 100644 --- a/configure.ac +++ b/configure.ac @@ -249,6 +249,16 @@ AC_ARG_ENABLE(nfsdcld, @@ -20,7 +94,7 @@ index f1c46c5..5d9cbf3 100644 [AS_HELP_STRING([--disable-nfsdcltrack],[disable NFSv4 clientid tracking programs @<:@default=no@:>@])], enable_nfsdcltrack=$enableval, diff --git a/support/export/auth.c b/support/export/auth.c -index 03ce4b8..2d7960f 100644 +index 03ce4b8a..2d7960f1 100644 --- a/support/export/auth.c +++ b/support/export/auth.c @@ -82,7 +82,7 @@ check_useipaddr(void) @@ -33,7 +107,7 @@ index 03ce4b8..2d7960f 100644 struct stat stb; static ino_t last_inode; diff --git a/support/export/v4clients.c b/support/export/v4clients.c -index 5f15b61..3230251 100644 +index 5f15b614..32302512 100644 --- a/support/export/v4clients.c +++ b/support/export/v4clients.c @@ -26,7 +26,7 @@ void v4clients_init(void) @@ -46,7 +120,7 @@ index 5f15b61..3230251 100644 return; if (clients_fd >= 0) diff --git a/support/export/v4root.c b/support/export/v4root.c -index c12a7d8..fbb0ad5 100644 +index c12a7d85..fbb0ad5f 100644 --- a/support/export/v4root.c +++ b/support/export/v4root.c @@ -198,7 +198,7 @@ static int v4root_add_parents(nfs_export *exp) @@ -59,7 +133,7 @@ index c12a7d8..fbb0ad5 100644 nfs_export *exp; int i; diff --git a/support/export/xtab.c b/support/export/xtab.c -index c888a80..e210ca9 100644 +index c888a80a..e210ca99 100644 --- a/support/export/xtab.c +++ b/support/export/xtab.c @@ -135,7 +135,7 @@ xtab_write(char *xtab, char *xtabtmp, char *lockfn, int is_export) @@ -72,7 +146,7 @@ index c888a80..e210ca9 100644 return xtab_write(etab.statefn, etab.tmpfn, etab.lockfn, 1); } diff --git a/support/nfs/xlog.c b/support/nfs/xlog.c -index e5861b9..fa125ce 100644 +index e5861b9d..fa125cef 100644 --- a/support/nfs/xlog.c +++ b/support/nfs/xlog.c @@ -46,11 +46,13 @@ int export_errno = 0; @@ -107,7 +181,7 @@ index e5861b9..fa125ce 100644 void diff --git a/support/nfsidmap/regex.c b/support/nfsidmap/regex.c -index 958b4ac..8424179 100644 +index 958b4ac8..8424179f 100644 --- a/support/nfsidmap/regex.c +++ b/support/nfsidmap/regex.c @@ -542,7 +542,7 @@ struct trans_func regex_trans = { @@ -120,7 +194,7 @@ index 958b4ac..8424179 100644 return (®ex_trans); } diff --git a/systemd/nfs.conf.man b/systemd/nfs.conf.man -index e74083e..b95c05a 100644 +index e74083e9..bfd3380f 100644 --- a/systemd/nfs.conf.man +++ b/systemd/nfs.conf.man @@ -98,6 +98,12 @@ value, which can be one or more from the list @@ -136,8 +210,16 @@ index e74083e..b95c05a 100644 .TP .B general Recognized values: +@@ -166,6 +172,7 @@ for details. + Recognized values: + .BR threads , + .BR host , ++.BR scope , + .BR port , + .BR grace-time , + .BR lease-time , diff --git a/tools/Makefile.am b/tools/Makefile.am -index 40c17c3..48fd0cd 100644 +index 40c17c37..48fd0cdf 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -12,6 +12,10 @@ if CONFIG_NFSDCLD @@ -153,7 +235,7 @@ index 40c17c3..48fd0cd 100644 MAINTAINERCLEANFILES = Makefile.in diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py -index 1df74ba..85294fb 100755 +index 1df74ba8..85294fb9 100755 --- a/tools/nfs-iostat/nfs-iostat.py +++ b/tools/nfs-iostat/nfs-iostat.py @@ -43,7 +43,7 @@ NfsEventCounters = [ @@ -198,7 +280,7 @@ index 1df74ba..85294fb 100755 print('(%.1f pages per call)' % \ (float(pages_read - vfsreadpage) / vfsreadpages)) diff --git a/tools/nfsrahead/Makefile.am b/tools/nfsrahead/Makefile.am -index 845ea0d..7e08233 100644 +index 845ea0d5..7e08233a 100644 --- a/tools/nfsrahead/Makefile.am +++ b/tools/nfsrahead/Makefile.am @@ -1,6 +1,6 @@ @@ -210,7 +292,7 @@ index 845ea0d..7e08233 100644 man5_MANS = nfsrahead.man diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c -index 2736ac8..bd89059 100644 +index 2736ac89..a565fdbd 100644 --- a/utils/blkmapd/device-discovery.c +++ b/utils/blkmapd/device-discovery.c @@ -187,10 +187,7 @@ static void bl_add_disk(char *filepath) @@ -258,8 +340,69 @@ index 2736ac8..bd89059 100644 } static void usage(void) { +@@ -507,28 +498,44 @@ int main(int argc, char **argv) + if (fg) { + openlog("blkmapd", LOG_PERROR, 0); + } else { +- if (daemon(0, 0) != 0) { +- fprintf(stderr, "Daemonize failed\n"); ++ pid_t pid = fork(); ++ if (pid < 0) { ++ BL_LOG_ERR("fork error\n"); + exit(1); ++ } else if (pid != 0) { ++ pidfd = open(PID_FILE, O_WRONLY | O_CREAT, 0644); ++ if (pidfd < 0) { ++ BL_LOG_ERR("Create pid file %s failed\n", PID_FILE); ++ exit(1); ++ } ++ ++ if (lockf(pidfd, F_TLOCK, 0) < 0) { ++ BL_LOG_ERR("Already running; Exiting!"); ++ close(pidfd); ++ exit(1); ++ } ++ if (ftruncate(pidfd, 0) < 0) ++ BL_LOG_ERR("ftruncate on %s failed: m\n", PID_FILE); ++ sprintf(pidbuf, "%d\n", pid); ++ if (write(pidfd, pidbuf, strlen(pidbuf)) != (ssize_t)strlen(pidbuf)) ++ BL_LOG_ERR("write on %s failed: m\n", PID_FILE); ++ exit(0); + } + +- openlog("blkmapd", LOG_PID, 0); +- pidfd = open(PID_FILE, O_WRONLY | O_CREAT, 0644); +- if (pidfd < 0) { +- BL_LOG_ERR("Create pid file %s failed\n", PID_FILE); +- exit(1); ++ (void)setsid(); ++ if (chdir("/")) { ++ BL_LOG_ERR("chdir error\n"); + } ++ int fd = open("/dev/null", O_RDWR, 0); ++ if (fd >= 0) { ++ (void)dup2(fd, STDIN_FILENO); ++ (void)dup2(fd, STDOUT_FILENO); ++ (void)dup2(fd, STDERR_FILENO); + +- if (lockf(pidfd, F_TLOCK, 0) < 0) { +- BL_LOG_ERR("Already running; Exiting!"); +- close(pidfd); +- exit(1); ++ (void)close(fd); + } +- if (ftruncate(pidfd, 0) < 0) +- BL_LOG_WARNING("ftruncate on %s failed: m\n", PID_FILE); +- sprintf(pidbuf, "%d\n", getpid()); +- if (write(pidfd, pidbuf, strlen(pidbuf)) != (ssize_t)strlen(pidbuf)) +- BL_LOG_WARNING("write on %s failed: m\n", PID_FILE); ++ ++ openlog("blkmapd", LOG_PID, 0); + } + + signal(SIGINT, sig_die); diff --git a/utils/blkmapd/device-discovery.h b/utils/blkmapd/device-discovery.h -index a86eed9..462aa94 100644 +index a86eed99..462aa943 100644 --- a/utils/blkmapd/device-discovery.h +++ b/utils/blkmapd/device-discovery.h @@ -151,6 +151,8 @@ uint64_t process_deviceinfo(const char *dev_addr_buf, @@ -272,7 +415,7 @@ index a86eed9..462aa94 100644 extern enum bl_path_state_e bldev_read_ap_state(int fd); extern int bl_discover_devices(void); diff --git a/utils/blkmapd/device-inq.c b/utils/blkmapd/device-inq.c -index c7952c3..9e5749e 100644 +index c7952c3e..9e5749ef 100644 --- a/utils/blkmapd/device-inq.c +++ b/utils/blkmapd/device-inq.c @@ -53,7 +53,7 @@ @@ -294,7 +437,7 @@ index c7952c3..9e5749e 100644 if (str) free(str); diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c -index 6ba615d..0897b22 100644 +index 6ba615d1..0897b229 100644 --- a/utils/exportfs/exportfs.c +++ b/utils/exportfs/exportfs.c @@ -69,14 +69,14 @@ static int _lockfd = -1; @@ -315,7 +458,7 @@ index 6ba615d..0897b22 100644 if (_lockfd != -1) { lockf(_lockfd, F_ULOCK, 0); diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c -index e79c124..cd9a965 100644 +index e79c124d..cd9a965f 100644 --- a/utils/idmapd/idmapd.c +++ b/utils/idmapd/idmapd.c @@ -867,7 +867,7 @@ nfsdreopen_one(struct idmap_client *ic) @@ -328,7 +471,7 @@ index e79c124..cd9a965 100644 nfsdreopen_one(&nfsd_ic[IC_NAMEID]); nfsdreopen_one(&nfsd_ic[IC_IDNAME]); diff --git a/utils/mount/network.c b/utils/mount/network.c -index ed2f825..01ead49 100644 +index ed2f8253..01ead49f 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -179,7 +179,7 @@ static const unsigned long probe_mnt3_only[] = { @@ -341,7 +484,7 @@ index ed2f825..01ead49 100644 extern unsigned long config_default_proto; /* diff --git a/utils/mount/parse_dev.c b/utils/mount/parse_dev.c -index 0d3bcb9..2ade5d5 100644 +index 0d3bcb95..2ade5d5d 100644 --- a/utils/mount/parse_dev.c +++ b/utils/mount/parse_dev.c @@ -170,7 +170,8 @@ static int nfs_parse_square_bracket(const char *dev, @@ -354,11 +497,104 @@ index 0d3bcb9..2ade5d5 100644 return nfs_pdn_nomem_err(); } } +diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c +index 4016a761..249df00b 100644 +--- a/utils/nfsd/nfsd.c ++++ b/utils/nfsd/nfsd.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + #include "conffile.h" + #include "nfslib.h" +@@ -39,6 +40,7 @@ static void usage(const char *); + static struct option longopts[] = + { + { "host", 1, 0, 'H' }, ++ { "scope", 1, 0, 'S'}, + { "help", 0, 0, 'h' }, + { "no-nfs-version", 1, 0, 'N' }, + { "nfs-version", 1, 0, 'V' }, +@@ -69,6 +71,7 @@ main(int argc, char **argv) + int count = NFSD_NPROC, c, i, error = 0, portnum, fd, found_one; + char *p, *progname, *port, *rdma_port = NULL; + char **haddr = NULL; ++ char *scope = NULL; + int hcounter = 0; + struct conf_list *hosts; + int socket_up = 0; +@@ -168,8 +171,9 @@ main(int argc, char **argv) + hcounter++; + } + } ++ scope = conf_get_str("nfsd", "scope"); + +- while ((c = getopt_long(argc, argv, "dH:hN:V:p:P:stTuUrG:L:", longopts, NULL)) != EOF) { ++ while ((c = getopt_long(argc, argv, "dH:S:hN:V:p:P:stTuUrG:L:", longopts, NULL)) != EOF) { + switch(c) { + case 'd': + xlog_config(D_ALL, 1); +@@ -190,6 +194,9 @@ main(int argc, char **argv) + haddr[hcounter] = optarg; + hcounter++; + break; ++ case 'S': ++ scope = optarg; ++ break; + case 'P': /* XXX for nfs-server compatibility */ + case 'p': + /* only the last -p option has any effect */ +@@ -367,6 +374,14 @@ main(int argc, char **argv) + if (lease > 0) + nfssvc_set_time("lease", lease); + ++ if (scope) { ++ if (unshare(CLONE_NEWUTS) < 0 || ++ sethostname(scope, strlen(scope)) < 0) { ++ xlog(L_ERROR, "Unable to set server scope: %m"); ++ error = -1; ++ goto out; ++ } ++ } + i = 0; + do { + error = nfssvc_set_sockets(protobits, haddr[i], port); diff --git a/utils/nfsd/nfsd.man b/utils/nfsd/nfsd.man -index 634b8a6..bb99fe2 100644 +index 634b8a63..dc05f362 100644 --- a/utils/nfsd/nfsd.man +++ b/utils/nfsd/nfsd.man -@@ -159,7 +159,9 @@ Enable or disable TCP support. +@@ -35,9 +35,17 @@ Note that + .B lockd + (which performs file locking services for NFS) may still accept + request on all known network addresses. This may change in future +-releases of the Linux Kernel. This option can be used multiple time ++releases of the Linux Kernel. This option can be used multiple times + to listen to more than one interface. + .TP ++.B \S " or " \-\-scope scope ++NFSv4.1 and later require the server to report a "scope" which is used ++by the clients to detect if two connections are to the same server. ++By default Linux NFSD uses the host name as the scope. ++.sp ++It is particularly important for high-availablity configurations to ensure ++that all potential server nodes report the same server scope. ++.TP + .B \-p " or " \-\-port port + specify a different port to listen on for NFS requests. By default, + .B rpc.nfsd +@@ -134,6 +142,9 @@ will listen on. Use of the + .B --host + option replaces all host names listed here. + .TP ++.B scope ++Set the server scope. ++.TP + .B grace-time + The grace time, for both NFSv4 and NLM, in seconds. + .TP +@@ -159,7 +170,9 @@ Enable or disable TCP support. .B vers3 .TP .B vers4 diff --git a/nfs-utils.spec b/nfs-utils.spec index b2e1333..56f4a9e 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser Name: nfs-utils URL: http://linux-nfs.org/ Version: 2.6.2 -Release: 1.rc3%{?dist} +Release: 2.rc4%{?dist} Epoch: 1 # group all 32bit related archs @@ -14,7 +14,7 @@ Source2: lockd.conf Source3: 24-nfs-server.conf Source4: 10-nfsv4.conf -Patch001: nfs-utils.2.6.3-rc3.patch +Patch001: nfs-utils.2.6.3-rc4.patch Patch100: nfs-utils-1.2.1-statdpath-man.patch Patch101: nfs-utils-1.2.1-exp-subtree-warn-off.patch @@ -293,8 +293,10 @@ fi /bin/systemctl --system daemon-reload >/dev/null 2>&1 || : -%triggerin -- nfs-utils > 1:2.1.1-3 +%triggerin -- nfs-utils > 1:2.6.2-1 /bin/systemctl try-restart gssproxy || : +rm -rf /etc/systemd/system/nfs-*.requires +rm -rf /etc/systemd/system/rpc-*.requires %triggerun -- nfs-utils > 1:2.6.2-0 /bin/systemctl disable nfs-convert > /dev/null 2>&1 || : @@ -453,6 +455,10 @@ fi %{_mandir}/*/nfsiostat.8.gz %changelog +* Mon Nov 28 2022 Steve Dickson 2.6.2-2.rc4 +- Updated to the latest RC release: nfs-utils-2-6-3-rc4 (bz 2144605) +- Remove old nfsconvert dependencies (bz 2144179) + * Mon Nov 7 2022 Steve Dickson 2.6.2-1.rc3 - Updated to the latest RC release: nfs-utils-2-6-3-rc3 (bz 2140201)