From 6df8f0e2dfede60cbdd3b64b80f1e0b40c5f97cf8a3b026f4b903391f529950c Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 5 Feb 2020 22:14:57 +0000 Subject: [PATCH 1/2] - 0009-Allow-compilation-to-succeed-with-fno-common.patch Allow compilation to success with -fno-common (boo#1160405) OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=212 --- ...mpilation-to-succeed-with-fno-common.patch | 59 +++++++++++++++++++ nfs-utils.changes | 7 +++ nfs-utils.spec | 6 +- 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 0009-Allow-compilation-to-succeed-with-fno-common.patch diff --git a/0009-Allow-compilation-to-succeed-with-fno-common.patch b/0009-Allow-compilation-to-succeed-with-fno-common.patch new file mode 100644 index 0000000..fafb521 --- /dev/null +++ b/0009-Allow-compilation-to-succeed-with-fno-common.patch @@ -0,0 +1,59 @@ +From 212832f065dac884a2e9bc858263d7735b6e2230 Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Thu, 6 Feb 2020 08:59:13 +1100 +Subject: [PATCH] Allow compilation to succeed with -fno-common + +When compiled with -fno-common, global variables that are declared +multple times cause an error. With -fcommon (the default), they are +merged. + +Declaring such variable multiple times is probably not a good idea, and +is definitely not necessary. + +This patch changes all the global variables defined in include files to +be explicitly "extern", and where necessary, adds the variable +declaration to a suitable .c file. + +To test, run + CFLAGS=-fno-common ./configure + make + +Signed-off-by: NeilBrown +--- + utils/mountd/v4root.c | 2 -- + utils/statd/statd.c | 1 + + utils/statd/statd.h | 2 +- + 3 files changed, 2 insertions(+), 3 deletions(-) + +--- a/utils/mountd/v4root.c ++++ b/utils/mountd/v4root.c +@@ -28,8 +28,6 @@ + #include "v4root.h" + #include "pseudoflavors.h" + +-int v4root_needed; +- + static nfs_export pseudo_root = { + .m_next = NULL, + .m_client = NULL, +--- a/utils/statd/statd.c ++++ b/utils/statd/statd.c +@@ -67,6 +67,7 @@ static struct option longopts[] = + }; + + extern void sm_prog_1 (struct svc_req *, register SVCXPRT *); ++stat_chge SM_stat_chge; + + #ifdef SIMULATIONS + extern void simulator (int, char **); +--- a/utils/statd/statd.h ++++ b/utils/statd/statd.h +@@ -41,7 +41,7 @@ extern void load_state(void); + /* + * Host status structure and macros. + */ +-stat_chge SM_stat_chge; ++extern stat_chge SM_stat_chge; + #define MY_NAME SM_stat_chge.mon_name + #define MY_STATE SM_stat_chge.state + diff --git a/nfs-utils.changes b/nfs-utils.changes index b209f2d..aecb020 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Feb 5 22:13:28 UTC 2020 - Neil Brown + +- 0009-Allow-compilation-to-succeed-with-fno-common.patch + Allow compilation to success with -fno-common + (boo#1160405) + ------------------------------------------------------------------- Wed Nov 20 23:55:31 UTC 2019 - Neil Brown diff --git a/nfs-utils.spec b/nfs-utils.spec index ae5d9b0..1c352b3 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -1,7 +1,7 @@ # # spec file for package nfs-utils # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -27,7 +27,7 @@ Release: 0 Summary: Support Utilities for Kernel nfsd License: GPL-2.0-or-later Group: Productivity/Networking/NFS -Url: http://kernel.org/pub/linux/utils/nfs-utils/ +URL: http://kernel.org/pub/linux/utils/nfs-utils/ Source0: http://kernel.org/pub/linux/utils/nfs-utils/%{version}/nfs-utils-%{version}.tar.xz # Download does not work: # Source1: ftp://nfs.sourceforge.net/pub/nfs/nfs.doc.tar.bz2 @@ -53,6 +53,7 @@ Patch5: 0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch Patch6: 0006-conffile-allow-optional-include-files.patch Patch7: 0007-statd-user-from-sm Patch8: 0008-mountd-Initialize-logging-early.patch +Patch0: 0009-Allow-compilation-to-succeed-with-fno-common.patch BuildRequires: e2fsprogs-devel BuildRequires: fedfs-utils-devel @@ -158,6 +159,7 @@ This package contains additional NFS documentation. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 cp %{SOURCE6} . From d17cc44ca7dc26617ff015cbe4dd59732d1a6f5a0b9c4c535962c360ad609b74 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 11 Feb 2020 22:25:46 +0000 Subject: [PATCH 2/2] Accepting request 773318 from home:pevik:branches:Base:System - Update to version 2.4.3 Dropped patches (accepted upstream): - 0001-nfs.conf-allow-empty-assignments.patch - 0002-Let-systemd-know-when-rpc.statd-is-needed.patch - 0003-systemd-run-statd-notify-even-when-nfs-client-isn-t-.patch - 0004-nfsidmap-honour-with-pluginpath-for-instalation.patch - 0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch - 0006-conffile-allow-optional-include-files.patch - 0007-statd-user-from-sm - 0008-mountd-Initialize-logging-early.patch Dropped patches (upstream used different solution): - 0009-Allow-compilation-to-succeed-with-fno-common.patch (btw this used Patch0: instead of Patch10:) (boo#1160405) Add nfsdcld - NFSv4 Client Tracking Daemon, add nfsdcld.service and enable it for nfs-kernel-server, add man page Add clddb-tool - tool for downgrading the nfsdcld sqlite database schema, add man page Removed osd_login (dropped in upstream in 2.3.4 rc1) OBS-URL: https://build.opensuse.org/request/show/773318 OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=213 --- 0001-nfs.conf-allow-empty-assignments.patch | 55 ----------------- ...ystemd-know-when-rpc.statd-is-needed.patch | 54 ---------------- ...d-notify-even-when-nfs-client-isn-t-.patch | 38 ------------ ...nour-with-pluginpath-for-instalation.patch | 39 ------------ ...-disable-major-NFS-version-4-using-v.patch | 60 ------------------ ...onffile-allow-optional-include-files.patch | 61 ------------------- 0007-statd-user-from-sm | 45 -------------- 0008-mountd-Initialize-logging-early.patch | 61 ------------------- ...mpilation-to-succeed-with-fno-common.patch | 59 ------------------ nfs-utils-2.3.3.tar.xz | 3 - nfs-utils-2.4.3.tar.xz | 3 + nfs-utils.changes | 24 ++++++++ nfs-utils.spec | 30 +++------ 13 files changed, 35 insertions(+), 497 deletions(-) delete mode 100644 0001-nfs.conf-allow-empty-assignments.patch delete mode 100644 0002-Let-systemd-know-when-rpc.statd-is-needed.patch delete mode 100644 0003-systemd-run-statd-notify-even-when-nfs-client-isn-t-.patch delete mode 100644 0004-nfsidmap-honour-with-pluginpath-for-instalation.patch delete mode 100644 0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch delete mode 100644 0006-conffile-allow-optional-include-files.patch delete mode 100644 0007-statd-user-from-sm delete mode 100644 0008-mountd-Initialize-logging-early.patch delete mode 100644 0009-Allow-compilation-to-succeed-with-fno-common.patch delete mode 100644 nfs-utils-2.3.3.tar.xz create mode 100644 nfs-utils-2.4.3.tar.xz diff --git a/0001-nfs.conf-allow-empty-assignments.patch b/0001-nfs.conf-allow-empty-assignments.patch deleted file mode 100644 index eb3f2df..0000000 --- a/0001-nfs.conf-allow-empty-assignments.patch +++ /dev/null @@ -1,55 +0,0 @@ -From b8ebadacd1ccf943e3c699027bdc64bdcf5e9f37 Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Mon, 3 Dec 2018 11:54:16 +1100 -Subject: [PATCH] nfs.conf: allow empty assignments. - -A recent commit caused an error message (but didn't actually -trigger an error) for a config file line like: - - foo = - -There is no good reason to treat this as an error, and we (SUSE) have -established practice of expecting these to be accepted. -Specifically "/etc/nfs.conf" includes "/etc/sysconfig/nfs" which -contains lots of empty definitions. - -So remove the error message. - -Fixes: 1c2c18806800 ("nfs.conf: Removed buffer overruns") -Signed-off-by: NeilBrown ---- - support/nfs/conffile.c | 5 ----- - tests/nfsconf/01-errors.exp | 1 - - 2 files changed, 6 deletions(-) - -diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c -index 0e39aca6b468..77c5790c893c 100644 ---- a/support/nfs/conffile.c -+++ b/support/nfs/conffile.c -@@ -405,11 +405,6 @@ conf_parse_line(int trans, char *line, const char *filename, int lineno, char ** - "missing tag in assignment", filename, lineno); - return; - } -- if (*val == '\0') { -- xlog_warn("config error at %s:%d: " -- "missing value in assignment", filename, lineno); -- return; -- } - - if (strcasecmp(line, "include")==0) { - /* load and parse subordinate config files */ -diff --git a/tests/nfsconf/01-errors.exp b/tests/nfsconf/01-errors.exp -index 2bf1b8c7f65b..0b985b46267e 100644 ---- a/tests/nfsconf/01-errors.exp -+++ b/tests/nfsconf/01-errors.exp -@@ -4,7 +4,6 @@ nfsconf: config error at 01-errors.conf:10: non-matched ']', ignoring until next - nfsconf: config error at 01-errors.conf:11: ignoring line not in a section - nfsconf: config error at 01-errors.conf:14: line not empty and not an assignment - nfsconf: config error at 01-errors.conf:15: missing tag in assignment --nfsconf: config error at 01-errors.conf:16: missing value in assignment - nfsconf: config error at 01-errors.conf:18: unmatched quotes - [four] - four = foo = bar --- -2.14.0.rc0.dirty - diff --git a/0002-Let-systemd-know-when-rpc.statd-is-needed.patch b/0002-Let-systemd-know-when-rpc.statd-is-needed.patch deleted file mode 100644 index 9ee869e..0000000 --- a/0002-Let-systemd-know-when-rpc.statd-is-needed.patch +++ /dev/null @@ -1,54 +0,0 @@ -From b468dda439a02c4d1b7f85a0be6c0a227d16c2de Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Fri, 30 Nov 2018 16:38:45 +1100 -Subject: [PATCH] Let systemd know when rpc.statd is needed. - -A recent change to set IgnoreOnIsolate for rpc-statd -isn't quite sufficient (though it doesn't hurt). -While rpc-statd does remain when - systemctl isolate multi-user -is run, its dependencies don't remain, so rpcbind might -get killed, which makes rpc.statd rather useless. - -The reason this is all an issue is that systemd doesn't know that -rpc-statd is needed - mount.nfs explicitly starts it rather than -having a dependency start it. -This can be rectified by explicitly telling systemd about the -dependency using "systemctl add-wants". This can be done in the -start-statd script, at the same time that rpc-statd is started. - -As --runtime dependency is used so that it doesn't persist across -reboots. A new dependency will be created on next boot if an NFSv3 -filesystem is mounted. - -With this in place, both rpc.statd and rpcbind remain. -Actually, rpcbind.service is stopped, but rpcbind.socket remains, -and when anything tries to contact rpcbind, rpcbind.service -is automatically started and it re-reads its saved state. - -Signed-off-by: NeilBrown ---- - utils/statd/start-statd | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/utils/statd/start-statd b/utils/statd/start-statd -index 82715b40c1af..54ced822016a 100755 ---- a/utils/statd/start-statd -+++ b/utils/statd/start-statd -@@ -20,7 +20,12 @@ fi - # First try systemd if it's installed. - if [ -d /run/systemd/system ]; then - # Quit only if the call worked. -- systemctl start rpc-statd.service && exit -+ if systemctl start rpc-statd.service; then -+ # Ensure systemd knows not to stop rpc.statd or its dependencies -+ # on 'systemctl isolate ..' -+ systemctl add-wants --runtime remote-fs.target rpc-statd.service -+ exit 0 -+ fi - fi - - cd / --- -2.14.0.rc0.dirty - diff --git a/0003-systemd-run-statd-notify-even-when-nfs-client-isn-t-.patch b/0003-systemd-run-statd-notify-even-when-nfs-client-isn-t-.patch deleted file mode 100644 index e2413b7..0000000 --- a/0003-systemd-run-statd-notify-even-when-nfs-client-isn-t-.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 415dea8db90785c3063bbd74fff34cb6a4830f06 Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Fri, 30 Nov 2018 16:44:29 +1100 -Subject: [PATCH] systemd: run statd-notify even when nfs-client isn't enabled. - -When NFS filesytems are mounted, nfs-client.target really should -be enabled. However it is possible to mount NFS filesystems -without this (providing gss isn't used) and it mostly works. - -One aspect that doesn't work is that sm-notify isn't run, so the server -isn't told to drop any locks from the previous client instance. -This can result in confusing failures: if a client crashes while -holding a lock, it won't be able to get the same lock after a reboot. - -While this isn't a complete solution (nfs-client really should be -enabled), adding a dependency from rpc-statd to rpc-statd-notify is -easy, has no down sides, and could help avoid confusion. - -Signed-off-by: NeilBrown ---- - systemd/rpc-statd.service | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/systemd/rpc-statd.service b/systemd/rpc-statd.service -index 1f4e6a8b92ab..3e92cf71add0 100644 ---- a/systemd/rpc-statd.service -+++ b/systemd/rpc-statd.service -@@ -4,6 +4,7 @@ DefaultDependencies=no - Conflicts=umount.target - Requires=nss-lookup.target rpcbind.socket - Wants=network-online.target -+Wants=rpc-statd-notify.service - After=network-online.target nss-lookup.target rpcbind.socket - - PartOf=nfs-utils.service --- -2.14.0.rc0.dirty - diff --git a/0004-nfsidmap-honour-with-pluginpath-for-instalation.patch b/0004-nfsidmap-honour-with-pluginpath-for-instalation.patch deleted file mode 100644 index 5ab82b1..0000000 --- a/0004-nfsidmap-honour-with-pluginpath-for-instalation.patch +++ /dev/null @@ -1,39 +0,0 @@ -From b535ba0513fd53bb3ae63d13b55b4784e056e225 Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Tue, 4 Dec 2018 11:00:10 +1100 -Subject: [PATCH] nfsidmap: honour --with-pluginpath for instalation. - -The path set with --with-pluginpath is not currently -used when installing plugins. It should be. - -Signed-off-by: NeilBrown ---- - configure.ac | 1 + - support/nfsidmap/Makefile.am | 2 +- - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 4163f6a518f5..4bf5aea4442f 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -450,6 +450,7 @@ if test -n "$path_plugins" ; then - [Define this to change the plugins path]) - fi - AM_CONDITIONAL(PATH_PLUGINS, test -n "$path_plugins") -+AC_SUBST(PATH_PLUGINS, "$path_plugins") - - AC_SUBST(AM_CPPFLAGS, "$AM_CPPFLAGS") - AC_DEFINE([HAVE_NFS4_SET_DEBUG], 1, -diff --git a/support/nfsidmap/Makefile.am b/support/nfsidmap/Makefile.am -index 8b5dfe4e784a..cdbeb4c1a9ac 100644 ---- a/support/nfsidmap/Makefile.am -+++ b/support/nfsidmap/Makefile.am -@@ -1,4 +1,4 @@ --pkgplugindir=$(libdir)/libnfsidmap -+pkgplugindir=$(PATH_PLUGINS) - - if ENABLE_LDAP - UMICH_LDAP_LIB = umich_ldap.la --- -2.14.0.rc0.dirty - diff --git a/0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch b/0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch deleted file mode 100644 index 9664b50..0000000 --- a/0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch +++ /dev/null @@ -1,60 +0,0 @@ -From d68be5d6ae5086d6b4ad84507d0d14011df40aa2 Mon Sep 17 00:00:00 2001 -From: Justin Mitchell -Date: Wed, 26 Sep 2018 10:37:17 -0400 -Subject: [PATCH] nfs.conf: fail to disable major NFS version 4 using "vers4=n" - in /etc/nfs.conf - -Setting "vers4=n/off" (disabling the major NFS version 4) in nfs.conf -doesn't work now. - -Refer to rpc.nfsd(8), "vers3/vers4" in the [nfsd] section of the -/etc/nfs.conf file is to enable or disable a major NFS version 3 or 4 -(which are normally enabled by default). - -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1625032 - -Signed-off-by: Steve Dickson ---- - utils/nfsd/nfsd.c | 15 ++++++++++++--- - 1 file changed, 12 insertions(+), 3 deletions(-) - -diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c -index 6b57e2b0790e..b256bd9f6b40 100644 ---- a/utils/nfsd/nfsd.c -+++ b/utils/nfsd/nfsd.c -@@ -83,6 +83,9 @@ main(int argc, char **argv) - - conf_init_file(NFS_CONFFILE); - xlog_from_conffile("nfsd"); -+ -+ nfssvc_get_minormask(&minormask); -+ - count = conf_get_num("nfsd", "threads", count); - grace = conf_get_num("nfsd", "grace-time", grace); - lease = conf_get_num("nfsd", "lease-time", lease); -@@ -101,13 +104,19 @@ main(int argc, char **argv) - for (i = 2; i <= 4; i++) { - char tag[20]; - sprintf(tag, "vers%d", i); -- if (conf_get_bool("nfsd", tag, NFSCTL_VERISSET(versbits, i))) -+ if (conf_get_bool("nfsd", tag, NFSCTL_VERISSET(versbits, i))) { - NFSCTL_VERSET(versbits, i); -- else -+ if (i == 4) -+ minorvers = minorversset = minormask; -+ } else { - NFSCTL_VERUNSET(versbits, i); -+ if (i == 4) { -+ minorvers = 0; -+ minorversset = minormask; -+ } -+ } - } - -- nfssvc_get_minormask(&minormask); - /* We assume the kernel will default all minor versions to 'on', - * and allow the config file to disable some. - */ --- -2.14.0.rc0.dirty - diff --git a/0006-conffile-allow-optional-include-files.patch b/0006-conffile-allow-optional-include-files.patch deleted file mode 100644 index 7f25208..0000000 --- a/0006-conffile-allow-optional-include-files.patch +++ /dev/null @@ -1,61 +0,0 @@ -From f608217f6136c0e9fedc7bc728e4ba13ed295c4c Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Mon, 23 Sep 2019 11:20:39 +1000 -Subject: [PATCH] conffile: allow optional include files. - -If nfs.conf contains, for example - include = /etc/nfs.conf.local -and /etc/nfs.conf.local doesn't exist, then a warning is given. -Sometimes it is useful to have an optional include file which is -included if present, but for which an absence doesn't give a -warning. - -Systemd has a convention that a hyphen at the start of -an include file name marks it as optional, so add this convention -to nfs-utils. -So - include = -/etc/nfs.conf.local -will not give a warning if the file doesn't exist. - -Signed-off-by: NeilBrown ---- - support/nfs/conffile.c | 13 ++++++++++--- - systemd/nfs.conf.man | 3 +++ - 2 files changed, 13 insertions(+), 3 deletions(-) - ---- a/support/nfs/conffile.c -+++ b/support/nfs/conffile.c -@@ -413,11 +413,18 @@ conf_parse_line(int trans, char *line, c - - if (strcasecmp(line, "include")==0) { - /* load and parse subordinate config files */ -+ _Bool optional = false; -+ -+ if (val && *val == '-') { -+ optional = true; -+ val++; -+ } -+ - relpath = relative_path(filename, val); - if (relpath == NULL) { -- xlog_warn("config error at %s:%d: " -- "error loading included config", -- filename, lineno); -+ if (!optional) -+ xlog_warn("config error at %s:%d: error loading included config", -+ filename, lineno); - return; - } - ---- a/systemd/nfs.conf.man -+++ b/systemd/nfs.conf.man -@@ -65,6 +65,9 @@ section headers, then new sections will - included file appeared in place of the - .B include - line. -+If the file name starts with a hyphen then that is stripped off -+before the file is opened, and if file doesn't exist no warning is -+given. Normally a non-existent include file generates a warning. - .PP - Lookup of section and value names is case-insensitive. - diff --git a/0007-statd-user-from-sm b/0007-statd-user-from-sm deleted file mode 100644 index bd60df6..0000000 --- a/0007-statd-user-from-sm +++ /dev/null @@ -1,45 +0,0 @@ -statd: take user-id from /var/lib/nfs/sm - -Having /var/lib/nfs writeable by statd is not ideal -as there are files in there that statd doesn't need -to access. -Aftger dropping privs, statd and sm-notify only need to -access files in the directories sm and sm.bak. -So take the uid for these deamons from 'sm'. - -Signed-off-by: NeilBrown ---- - support/nsm/file.c | 16 +++++----------- - 1 file changed, 5 insertions(+), 11 deletions(-) - ---- a/support/nsm/file.c -+++ b/support/nsm/file.c -@@ -388,23 +388,17 @@ nsm_drop_privileges(const int pidfd) - - (void)umask(S_IRWXO); - -- /* -- * XXX: If we can't stat dirname, or if dirname is owned by -- * root, we should use "statduser" instead, which is set up -- * by configure.ac. Nothing in nfs-utils seems to use -- * "statduser," though. -- */ -- if (lstat(nsm_base_dirname, &st) == -1) { -- xlog(L_ERROR, "Failed to stat %s: %m", nsm_base_dirname); -- return false; -- } -- - if (chdir(nsm_base_dirname) == -1) { - xlog(L_ERROR, "Failed to change working directory to %s: %m", - nsm_base_dirname); - return false; - } - -+ if (lstat(NSM_MONITOR_DIR, &st) == -1) { -+ xlog(L_ERROR, "Failed to stat %s/%s: %m", nsm_base_dirname, NSM_MONITOR_DIR); -+ return false; -+ } -+ - if (!prune_bounding_set()) - return false; - diff --git a/0008-mountd-Initialize-logging-early.patch b/0008-mountd-Initialize-logging-early.patch deleted file mode 100644 index 0121956..0000000 --- a/0008-mountd-Initialize-logging-early.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 30961f1bf9be6117aa825e7bfc8b327c93d3aacd Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Mon, 23 Sep 2019 11:10:31 +1000 -Subject: [PATCH] mountd: Initialize logging early. - -Reading the config file can generate log messages, -so we should initialize logging before reading the -config file. - -If any log message are generated, syslog will leave -a file descriptor open (a socket), so calling -closeall(3) after this can cause problem. -Before this we initialize login we don't know if -Foreground (-F) has been selected, so closeall() -cannot be conditional on that. - -closeall() isn't needed - daemon are almost always run -from a management daemon like systemd, and they are given -a clean environment. It is really best if they just take -what they are given. - -So remove the closeall() call. - -Signed-off-by: NeilBrown ---- - utils/mountd/mountd.c | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - ---- a/utils/mountd/mountd.c -+++ b/utils/mountd/mountd.c -@@ -679,6 +679,9 @@ main(int argc, char **argv) - else - progname = argv[0]; - -+ /* Initialize logging. */ -+ xlog_open(progname); -+ - conf_init_file(NFS_CONFFILE); - xlog_from_conffile("mountd"); - manage_gids = conf_get_bool("mountd", "manage-gids", manage_gids); -@@ -818,9 +821,7 @@ main(int argc, char **argv) - } - } - } -- /* Initialize logging. */ - if (!foreground) xlog_stderr(0); -- xlog_open(progname); - - sa.sa_handler = SIG_IGN; - sa.sa_flags = 0; -@@ -832,10 +833,6 @@ main(int argc, char **argv) - /* WARNING: the following works on Linux and SysV, but not BSD! */ - sigaction(SIGCHLD, &sa, NULL); - -- /* Daemons should close all extra filehandles ... *before* RPC init. */ -- if (!foreground) -- closeall(3); -- - cache_open(); - - unregister_services(); diff --git a/0009-Allow-compilation-to-succeed-with-fno-common.patch b/0009-Allow-compilation-to-succeed-with-fno-common.patch deleted file mode 100644 index fafb521..0000000 --- a/0009-Allow-compilation-to-succeed-with-fno-common.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 212832f065dac884a2e9bc858263d7735b6e2230 Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Thu, 6 Feb 2020 08:59:13 +1100 -Subject: [PATCH] Allow compilation to succeed with -fno-common - -When compiled with -fno-common, global variables that are declared -multple times cause an error. With -fcommon (the default), they are -merged. - -Declaring such variable multiple times is probably not a good idea, and -is definitely not necessary. - -This patch changes all the global variables defined in include files to -be explicitly "extern", and where necessary, adds the variable -declaration to a suitable .c file. - -To test, run - CFLAGS=-fno-common ./configure - make - -Signed-off-by: NeilBrown ---- - utils/mountd/v4root.c | 2 -- - utils/statd/statd.c | 1 + - utils/statd/statd.h | 2 +- - 3 files changed, 2 insertions(+), 3 deletions(-) - ---- a/utils/mountd/v4root.c -+++ b/utils/mountd/v4root.c -@@ -28,8 +28,6 @@ - #include "v4root.h" - #include "pseudoflavors.h" - --int v4root_needed; -- - static nfs_export pseudo_root = { - .m_next = NULL, - .m_client = NULL, ---- a/utils/statd/statd.c -+++ b/utils/statd/statd.c -@@ -67,6 +67,7 @@ static struct option longopts[] = - }; - - extern void sm_prog_1 (struct svc_req *, register SVCXPRT *); -+stat_chge SM_stat_chge; - - #ifdef SIMULATIONS - extern void simulator (int, char **); ---- a/utils/statd/statd.h -+++ b/utils/statd/statd.h -@@ -41,7 +41,7 @@ extern void load_state(void); - /* - * Host status structure and macros. - */ --stat_chge SM_stat_chge; -+extern stat_chge SM_stat_chge; - #define MY_NAME SM_stat_chge.mon_name - #define MY_STATE SM_stat_chge.state - diff --git a/nfs-utils-2.3.3.tar.xz b/nfs-utils-2.3.3.tar.xz deleted file mode 100644 index 54cde8f..0000000 --- a/nfs-utils-2.3.3.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f68b34793831b05f1fd5760d6bdec92772c7684177586a99a61e7b444f336322 -size 662280 diff --git a/nfs-utils-2.4.3.tar.xz b/nfs-utils-2.4.3.tar.xz new file mode 100644 index 0000000..836134b --- /dev/null +++ b/nfs-utils-2.4.3.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af65fce5dd8370cff9ead67baac5a6cd69c376dcadfef264dc2c78c904f26599 +size 685744 diff --git a/nfs-utils.changes b/nfs-utils.changes index aecb020..0f95062 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,27 @@ +------------------------------------------------------------------- +Mon Feb 10 18:58:59 UTC 2020 - Petr Vorel + +- Update to version 2.4.3 + Dropped patches (accepted upstream): + - 0001-nfs.conf-allow-empty-assignments.patch + - 0002-Let-systemd-know-when-rpc.statd-is-needed.patch + - 0003-systemd-run-statd-notify-even-when-nfs-client-isn-t-.patch + - 0004-nfsidmap-honour-with-pluginpath-for-instalation.patch + - 0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch + - 0006-conffile-allow-optional-include-files.patch + - 0007-statd-user-from-sm + - 0008-mountd-Initialize-logging-early.patch + + Dropped patches (upstream used different solution): + - 0009-Allow-compilation-to-succeed-with-fno-common.patch (btw this used + Patch0: instead of Patch10:) (boo#1160405) + + Add nfsdcld - NFSv4 Client Tracking Daemon, add nfsdcld.service and enable it + for nfs-kernel-server, add man page + Add clddb-tool - tool for downgrading the nfsdcld sqlite database schema, + add man page + Removed osd_login (dropped in upstream in 2.3.4 rc1) + ------------------------------------------------------------------- Wed Feb 5 22:13:28 UTC 2020 - Neil Brown diff --git a/nfs-utils.spec b/nfs-utils.spec index 1c352b3..4f3e49c 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -22,7 +22,7 @@ %endif Name: nfs-utils -Version: 2.3.3 +Version: 2.4.3 Release: 0 Summary: Support Utilities for Kernel nfsd License: GPL-2.0-or-later @@ -45,15 +45,6 @@ Source25: rpc-svcgssd.options.conf Source26: nfs.conf Source27: nfs-kernel-server.tmpfiles.conf Patch0: nfs-utils-1.0.7-bind-syntax.patch -Patch1: 0001-nfs.conf-allow-empty-assignments.patch -Patch2: 0002-Let-systemd-know-when-rpc.statd-is-needed.patch -Patch3: 0003-systemd-run-statd-notify-even-when-nfs-client-isn-t-.patch -Patch4: 0004-nfsidmap-honour-with-pluginpath-for-instalation.patch -Patch5: 0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch -Patch6: 0006-conffile-allow-optional-include-files.patch -Patch7: 0007-statd-user-from-sm -Patch8: 0008-mountd-Initialize-logging-early.patch -Patch0: 0009-Allow-compilation-to-succeed-with-fno-common.patch BuildRequires: e2fsprogs-devel BuildRequires: fedfs-utils-devel @@ -151,15 +142,6 @@ This package contains additional NFS documentation. %prep %setup -q -a 1 %patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 cp %{SOURCE6} . @@ -279,12 +261,12 @@ if [ -f %{_localstatedir}/lock/subsys/nfsserver-rpc.idmapd ]; then mv %{_localstatedir}/lock/subsys/nfsserver-rpc.idmapd /run/nfs fi ### -%service_add_post nfs-mountd.service nfs-server.service +%service_add_post nfs-mountd.service nfs-server.service nfsdcld.service %tmpfiles_create nfs-kernel-server.conf %set_permissions /var/lib/nfs/rmtab %postun -n nfs-kernel-server -%service_del_postun nfs-mountd.service nfs-server.service +%service_del_postun nfs-mountd.service nfs-server.service nfsdcld.service %verifyscript -n nfs-kernel-server %verify_permissions -e /var/lib/nfs/rmtab @@ -298,9 +280,10 @@ fi /sbin/mount.nfs4 /sbin/umount.nfs /sbin/umount.nfs4 -/sbin/osd_login %attr(0755,root,root) %{_sbindir}/mountstats %attr(0755,root,root) %{_sbindir}/nfsiostat +%{_sbindir}/clddb-tool +%{_sbindir}/nfsdcld %{_sbindir}/nfsidmap %{_sbindir}/nfsstat %{_sbindir}/rcnfs-client @@ -319,6 +302,7 @@ fi %{_unitdir}/nfs-client.target %{_unitdir}/nfs-idmapd.service %{_unitdir}/nfs-utils.service +%{_unitdir}/nfsdcld.service %{_unitdir}/rpc-gssd.service %{_unitdir}/rpc-gssd.service.d %{_unitdir}/rpc_pipefs.target @@ -332,9 +316,11 @@ fi %dir /usr/lib/systemd/system-generators /usr/lib/systemd/system-generators/nfs-server-generator /usr/lib/systemd/system-generators/rpc-pipefs-generator +%{_mandir}/man8/clddb-tool.8%{ext_man} %{_mandir}/man5/nfsmount.conf.5%{ext_man} %{_mandir}/man5/nfs.conf.5%{ext_man} %{_mandir}/man5/nfs.5%{ext_man} +%{_mandir}/man8/nfsdcld.8%{ext_man} %{_mandir}/man5/idmapd.conf.5%{ext_man} %{_mandir}/man7/nfs.systemd.7%{ext_man} %{_mandir}/man8/mount.nfs.8%{ext_man}