Accepting request 1080851 from home:pevik:branches:Base:System

- Update to version 2.6.3
  - https://kernel.org/pub/linux/utils/nfs-utils/2.6.3/2.6.3-Changelog
- Remove patches from this release:
  - 0006-nfsd-allow-server-scope-to-be-set-with-config-or-com.patch
  - 0007-mount.nfs-always-include-mountpoint-or-spec-if-error.patch
  - 0008-nfsd.man-fix-typo-in-section-on-scope.patch
- Remove systemd/50-nfs.conf (was removed in upstream in d8d29f85)
  and the realted patch (bsc#1200710).
  0005-modprobe-avoid-error-messages-if-sbin-sysctl-fail.patch.
- New file /usr/lib/udev/rules.d/60-nfs.rules (which replaced in upstream
  systemd/50-nfs.conf in 9466df03).
- Add fsidd:
  - /usr/lib/systemd/system/fsidd.service
  - /usr/lib/udev/rules.d/60-nfs.rules
  - /usr/sbin/fsidd

OBS-URL: https://build.opensuse.org/request/show/1080851
OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=275
This commit is contained in:
Neil Brown 2023-04-23 22:39:42 +00:00 committed by Git OBS Bridge
parent ef55f35a54
commit 946c3a339f
8 changed files with 26 additions and 301 deletions

View File

@ -1,40 +0,0 @@
From 040fc30d6d7684526c1556f20bc6bfec6b1c82ed Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Mon, 11 Jul 2022 13:25:38 +1000
Subject: [PATCH] modprobe: avoid error messages if /sbin/sysctl fail
If /sbin/sysctl fails, for example if it is not installed, then the
install line does not fail but we can still get an error message in the
logs, which could be annoying.
So hide any such error message - send it to /dev/null
Signed-off-by: NeilBrown <neilb@suse.de>
---
systemd/50-nfs.conf | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/systemd/50-nfs.conf
+++ b/systemd/50-nfs.conf
@@ -1,16 +1,16 @@
# Ensure all NFS systctl settings get applied when modules load
# sunrpc module supports "sunrpc.*" sysctls
-install sunrpc /sbin/modprobe --ignore-install sunrpc $CMDLINE_OPTS && { /sbin/sysctl -q --pattern sunrpc --system; exit 0; }
+install sunrpc /sbin/modprobe --ignore-install sunrpc $CMDLINE_OPTS && { /sbin/sysctl 2> /dev/null -q --pattern sunrpc --system; exit 0; }
# rpcrdma module supports sunrpc.svc_rdma.*
-install rpcrdma /sbin/modprobe --ignore-install rpcrdma $CMDLINE_OPTS && { /sbin/sysctl -q --pattern sunrpc.svc_rdma --system; exit 0; }
+install rpcrdma /sbin/modprobe --ignore-install rpcrdma $CMDLINE_OPTS && { /sbin/sysctl 2> /dev/null -q --pattern sunrpc.svc_rdma --system; exit 0; }
# lockd module supports "fs.nfs.nlm*" and "fs.nfs.nsm*" sysctls
-install lockd /sbin/modprobe --ignore-install lockd $CMDLINE_OPTS && { /sbin/sysctl -q --pattern fs.nfs.n[sl]m --system; exit 0; }
+install lockd /sbin/modprobe --ignore-install lockd $CMDLINE_OPTS && { /sbin/sysctl 2> /dev/null -q --pattern fs.nfs.n[sl]m --system; exit 0; }
# nfsv4 module supports "fs.nfs.*" sysctls (nfs_callback_tcpport and idmap_cache_timeout)
-install nfsv4 /sbin/modprobe --ignore-install nfsv4 $CMDLINE_OPTS && { /sbin/sysctl -q --pattern 'fs.nfs.(nfs_callback_tcpport|idmap_cache_timeout)' --system; exit 0; }
+install nfsv4 /sbin/modprobe --ignore-install nfsv4 $CMDLINE_OPTS && { /sbin/sysctl 2> /dev/null -q --pattern 'fs.nfs.(nfs_callback_tcpport|idmap_cache_timeout)' --system; exit 0; }
# nfs module supports "fs.nfs.*" sysctls
-install nfs /sbin/modprobe --ignore-install nfs $CMDLINE_OPTS && { /sbin/sysctl -q --pattern fs.nfs --system; exit 0; }
+install nfs /sbin/modprobe --ignore-install nfs $CMDLINE_OPTS && { /sbin/sysctl 2> /dev/null -q --pattern fs.nfs --system; exit 0; }

View File

@ -1,141 +0,0 @@
From 580ac005d11ddb9a9622e380ba8e947ad743a38f Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Mon, 21 Nov 2022 14:24:00 -0500
Subject: [PATCH] nfsd: allow server scope to be set with config or command
line.
NFSv4.1 and later require the server to report a "scope". Servers with
the same scope are expected to understand each other's state ids etc,
though may not accept them - this ensure there can be no
misunderstanding. This is helpful for migration.
Servers with different scope are known to be different and if a server
appears to change scope on a restart, lock recovery must not be
attempted.
It is important for fail-over configurations to have the same scope for
all server instances. Linux NFSD sets scope to host name. It is common
for fail-over configurations to use different host names on different
server nodes. So the default is not good for these configurations and
must be over-ridden.
As discussed in
https://github.com/ClusterLabs/resource-agents/issues/1644
some HA management tools attempt to address this with calls to "unshare"
and "hostname" before running "rpc.nfsd". This is unnecessarily
cumbersome.
This patch adds a "-S" command-line option and nfsd.scope config value
so that the scope can be set easily for nfsd.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
systemd/nfs.conf.man | 1 +
utils/nfsd/nfsd.c | 17 ++++++++++++++++-
utils/nfsd/nfsd.man | 13 ++++++++++++-
3 files changed, 29 insertions(+), 2 deletions(-)
--- a/systemd/nfs.conf.man
+++ b/systemd/nfs.conf.man
@@ -166,6 +166,7 @@ for details.
Recognized values:
.BR threads ,
.BR host ,
+.BR scope ,
.BR port ,
.BR grace-time ,
.BR lease-time ,
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -23,6 +23,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <sched.h>
#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);
--- a/utils/nfsd/nfsd.man
+++ b/utils/nfsd/nfsd.man
@@ -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

View File

@ -1,88 +0,0 @@
From e6dc15cbe1e0171055765f329d2f2b6a65ea9635 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Tue, 28 Mar 2023 13:49:57 +1100
Subject: [PATCH] mount.nfs: always include mountpoint or spec if error
messages.
If you try to mount from a server that is inaccessible you might get an
error like:
mount.nfs: No route to host
This is OK when running "mount" interactively, but hardly useful when
found in system logs.
This patch changes mount_error() to always included at least one of
mount_point and spec in any error message.
Signed-off-by: NeilBrown <neilb@suse.de>
---
utils/mount/error.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
--- a/utils/mount/error.c
+++ b/utils/mount/error.c
@@ -207,16 +207,17 @@ void mount_error(const char *spec, const
progname, spec);
break;
case EINVAL:
- nfs_error(_("%s: an incorrect mount option was specified"), progname);
+ nfs_error(_("%s: an incorrect mount option was specified for %s"),
+ progname, mount_point);
break;
case EOPNOTSUPP:
- nfs_error(_("%s: requested NFS version or transport protocol is not supported"),
- progname);
+ nfs_error(_("%s: requested NFS version or transport protocol is not supported for %s"),
+ progname, mount_point);
break;
case ENOTDIR:
if (spec)
- nfs_error(_("%s: mount spec %s or point %s is not a "
- "directory"), progname, spec, mount_point);
+ nfs_error(_("%s: mount spec %s or point %s is not a directory"),
+ progname, spec, mount_point);
else
nfs_error(_("%s: mount point %s is not a directory"),
progname, mount_point);
@@ -227,31 +228,31 @@ void mount_error(const char *spec, const
break;
case ENOENT:
if (spec)
- nfs_error(_("%s: mounting %s failed, "
- "reason given by server: %s"),
- progname, spec, strerror(error));
+ nfs_error(_("%s: mounting %s failed, reason given by server: %s"),
+ progname, spec, strerror(error));
else
nfs_error(_("%s: mount point %s does not exist"),
- progname, mount_point);
+ progname, mount_point);
break;
case ESPIPE:
rpc_mount_errors((char *)spec, 0, 0);
break;
case EIO:
- nfs_error(_("%s: mount system call failed"), progname);
+ nfs_error(_("%s: mount system call failed for %s"),
+ progname, mount_point);
break;
case EFAULT:
- nfs_error(_("%s: encountered unexpected error condition."),
- progname);
+ nfs_error(_("%s: encountered unexpected error condition for %s."),
+ progname, mount_point);
nfs_error(_("%s: please report the error to" PACKAGE_BUGREPORT),
- progname);
+ progname);
break;
case EALREADY:
/* Error message has already been provided */
break;
default:
- nfs_error(_("%s: %s"),
- progname, strerror(error));
+ nfs_error(_("%s: %s for %s on %s"),
+ progname, strerror(error), spec, mount_point);
}
}

View File

@ -1,23 +0,0 @@
From e986a7c109cb25fe9de2de3e376ac6ed09d9dd12 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Wed, 29 Mar 2023 09:08:32 +1100
Subject: [PATCH] nfsd.man: fix typo in section on "scope".
The missing "-" meant that "-S" isn't mentioned at all.
Signed-off-by: NeilBrown <neilb@suse.de>
---
utils/nfsd/nfsd.man | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/utils/nfsd/nfsd.man
+++ b/utils/nfsd/nfsd.man
@@ -38,7 +38,7 @@ request on all known network addresses.
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
+.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.

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5200873e81c4d610e2462fc262fe18135f2dbe78b7979f95accd159ae64d5011
size 716680

BIN
nfs-utils-2.6.3.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +1,22 @@
-------------------------------------------------------------------
Thu Apr 20 10:10:14 UTC 2023 - Petr Vorel <pvorel@suse.cz>
- Update to version 2.6.3
- https://kernel.org/pub/linux/utils/nfs-utils/2.6.3/2.6.3-Changelog
- Remove patches from this release:
- 0006-nfsd-allow-server-scope-to-be-set-with-config-or-com.patch
- 0007-mount.nfs-always-include-mountpoint-or-spec-if-error.patch
- 0008-nfsd.man-fix-typo-in-section-on-scope.patch
- Remove systemd/50-nfs.conf (was removed in upstream in d8d29f85)
and the realted patch (bsc#1200710).
0005-modprobe-avoid-error-messages-if-sbin-sysctl-fail.patch.
- New file /usr/lib/udev/rules.d/60-nfs.rules (which replaced in upstream
systemd/50-nfs.conf in 9466df03).
- Add fsidd:
- /usr/lib/systemd/system/fsidd.service
- /usr/lib/udev/rules.d/60-nfs.rules
- /usr/sbin/fsidd
-------------------------------------------------------------------
Tue Mar 28 22:37:58 UTC 2023 - Neil Brown <nfbrown@suse.com>

View File

@ -22,7 +22,7 @@
%endif
Name: nfs-utils
Version: 2.6.2
Version: 2.6.3
Release: 0
Summary: Support Utilities for Kernel nfsd
License: GPL-2.0-or-later
@ -42,10 +42,6 @@ Source25: rpc-svcgssd.options.conf
Source26: nfs.conf
Source27: nfs-kernel-server.tmpfiles.conf
Patch0: nfs-utils-1.0.7-bind-syntax.patch
Patch5: 0005-modprobe-avoid-error-messages-if-sbin-sysctl-fail.patch
Patch6: 0006-nfsd-allow-server-scope-to-be-set-with-config-or-com.patch
Patch7: 0007-mount.nfs-always-include-mountpoint-or-spec-if-error.patch
Patch8: 0008-nfsd.man-fix-typo-in-section-on-scope.patch
BuildRequires: e2fsprogs-devel
BuildRequires: gcc-c++
BuildRequires: libtool
@ -278,8 +274,10 @@ fi
%{_sbindir}/blkmapd
%{_sbindir}/rpc.svcgssd
%{_sbindir}/nfsconf
%{_udevrulesdir}/60-nfs.rules
%{_udevrulesdir}/99-nfs.rules
%{_unitdir}/auth-rpcgss-module.service
%{_unitdir}/fsidd.service
%{_unitdir}/nfs-blkmap.service
%{_unitdir}/nfs-client.target
%{_unitdir}/nfs-idmapd.service
@ -298,7 +296,6 @@ fi
%dir %{_systemdgeneratordir}
%{_systemdgeneratordir}/nfs-server-generator
%{_systemdgeneratordir}/rpc-pipefs-generator
%{_modprobedir}/50-nfs.conf
%{_mandir}/man5/idmapd.conf.5%{ext_man}
%{_mandir}/man5/nfs.5%{ext_man}
%{_mandir}/man5/nfs.conf.5%{ext_man}
@ -347,6 +344,7 @@ fi
%{_unitdir}/proc-fs-nfsd.mount
%{_prefix}/lib/tmpfiles.d/nfs-kernel-server.conf
%{_sbindir}/exportfs
%{_sbindir}/fsidd
%{_sbindir}/rcnfs-server
%{_sbindir}/rpc.mountd
%{_sbindir}/rpc.nfsd