Updated to the latest upstream release: nfs-utils-2-8-3
Plus additional fixes from nfs-utils-2-8-4-rc1. Resolves: RHEL-71286 Resolves: RHEL-82418 Resolves: RHEL-82557 Resolves: RHEL-85409 Resolves: RHEL-85413 Resolves: RHEL-88768 Signed-off-by: Scott Mayhew <smayhew@redhat.com>
This commit is contained in:
parent
1ceea4f7dd
commit
a9e1d8c00a
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
x86_64
|
||||
Makefile
|
||||
nfs-utils-2.8.2
|
||||
/nfs-utils-2.8.2.tar.xz
|
||||
nfs-utils-2.8.3
|
||||
/nfs-utils-2.8.3.tar.xz
|
||||
|
||||
@ -1,58 +0,0 @@
|
||||
commit 968f7b646ff70ff1d4669138c617ae5f1591e9b6
|
||||
Author: Steve Dickson <steved@redhat.com>
|
||||
Date: Sat Jan 11 04:51:33 2025 -0500
|
||||
|
||||
nfsdcltrack related manpage and configure file cleanup
|
||||
|
||||
Reported-by: Yongcheng Yang <yoyang@redhat.com>
|
||||
Reviewed-by: Jeff Layton <jlayton@kernel.org>
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-73500
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
|
||||
diff --git a/nfs.conf b/nfs.conf
|
||||
index 087d7372..3cca68c3 100644
|
||||
--- a/nfs.conf
|
||||
+++ b/nfs.conf
|
||||
@@ -60,10 +60,6 @@
|
||||
# debug=0
|
||||
# storagedir=/var/lib/nfs/nfsdcld
|
||||
#
|
||||
-[nfsdcltrack]
|
||||
-# debug=0
|
||||
-# storagedir=/var/lib/nfs/nfsdcltrack
|
||||
-#
|
||||
[nfsd]
|
||||
# debug=0
|
||||
# threads=16
|
||||
diff --git a/systemd/nfs.conf.man b/systemd/nfs.conf.man
|
||||
index d03fc887..e6a84a97 100644
|
||||
--- a/systemd/nfs.conf.man
|
||||
+++ b/systemd/nfs.conf.man
|
||||
@@ -158,19 +158,6 @@ is equivalent to providing the
|
||||
.B \-\-log\-auth
|
||||
option.
|
||||
|
||||
-.TP
|
||||
-.B nfsdcltrack
|
||||
-Recognized values:
|
||||
-.BR storagedir .
|
||||
-
|
||||
-The
|
||||
-.B nfsdcltrack
|
||||
-program is run directly by the Linux kernel and there is no
|
||||
-opportunity to provide command line arguments, so the configuration
|
||||
-file is the only way to configure this program. See
|
||||
-.BR nfsdcltrack (8)
|
||||
-for details.
|
||||
-
|
||||
.TP
|
||||
.B nfsd
|
||||
Recognized values:
|
||||
@@ -329,7 +316,6 @@ for deatils.
|
||||
Various configuration files read in order. Later settings override
|
||||
earlier settings.
|
||||
.SH SEE ALSO
|
||||
-.BR nfsdcltrack (8),
|
||||
.BR rpc.nfsd (8),
|
||||
.BR rpc.mountd (8),
|
||||
.BR nfsmount.conf (5).
|
||||
@ -1,182 +0,0 @@
|
||||
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
|
||||
index f787583e..a4056499 100644
|
||||
--- a/utils/nfsd/nfsd.c
|
||||
+++ b/utils/nfsd/nfsd.c
|
||||
@@ -68,7 +68,7 @@ read_nfsd_conf(void)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
- int count = NFSD_NPROC, c, i, error = 0, portnum, fd, found_one;
|
||||
+ int count = NFSD_NPROC, c, i, j, error = 0, portnum, fd, found_one;
|
||||
char *p, *progname, *port, *rdma_port = NULL;
|
||||
char **haddr = NULL;
|
||||
char *scope = NULL;
|
||||
@@ -330,11 +330,30 @@ main(int argc, char **argv)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
- /* make sure that at least one version is enabled */
|
||||
+ /*
|
||||
+ * Make sure that at least one version is enabled. Note that we might
|
||||
+ * need to check the minorvers bit field twice - first while handling
|
||||
+ * major version 4 in versbits, and again if no major verions were
|
||||
+ * enabled in versbits.
|
||||
+ */
|
||||
found_one = 0;
|
||||
- for (c = NFSD_MINVERS; c <= NFSD_MAXVERS; c++) {
|
||||
- if (NFSCTL_VERISSET(versbits, c))
|
||||
- found_one = 1;
|
||||
+ for (i = NFSD_MINVERS; i <= NFSD_MAXVERS; i++) {
|
||||
+ if (NFSCTL_VERISSET(versbits, i)) {
|
||||
+ if (i == 4) {
|
||||
+ for (j = NFS4_MINMINOR; j <= NFS4_MAXMINOR; j++) {
|
||||
+ if (NFSCTL_MINORISSET(minorvers, j))
|
||||
+ found_one = 1;
|
||||
+ }
|
||||
+ } else {
|
||||
+ found_one = 1;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ if (!found_one) {
|
||||
+ for (i = NFS4_MINMINOR; i <= NFS4_MAXMINOR; i++) {
|
||||
+ if (NFSCTL_MINORISSET(minorvers, i))
|
||||
+ found_one = 1;
|
||||
+ }
|
||||
}
|
||||
if (!found_one) {
|
||||
xlog(L_ERROR, "no version specified");
|
||||
diff --git a/utils/nfsdctl/nfsdctl.c b/utils/nfsdctl/nfsdctl.c
|
||||
index ef917ff0..0e93beda 100644
|
||||
--- a/utils/nfsdctl/nfsdctl.c
|
||||
+++ b/utils/nfsdctl/nfsdctl.c
|
||||
@@ -754,6 +754,19 @@ static int update_nfsd_version(int major, int minor, bool enabled)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
+static int get_max_minorversion(void)
|
||||
+{
|
||||
+ int i, max = 0;
|
||||
+
|
||||
+ for (i = 0; i < MAX_NFS_VERSIONS; ++i) {
|
||||
+ if (nfsd_versions[i].major == 0)
|
||||
+ break;
|
||||
+ if (nfsd_versions[i].major == 4 && nfsd_versions[i].minor > max)
|
||||
+ max = nfsd_versions[i].minor;
|
||||
+ }
|
||||
+ return max;
|
||||
+}
|
||||
+
|
||||
static void version_usage(void)
|
||||
{
|
||||
printf("Usage: %s version { {+,-}major.minor } ...\n", taskname);
|
||||
@@ -771,7 +784,7 @@ static void version_usage(void)
|
||||
|
||||
static int version_func(struct nl_sock *sock, int argc, char ** argv)
|
||||
{
|
||||
- int ret, i;
|
||||
+ int ret, i, j, max_minor;
|
||||
|
||||
/* help is only valid as first argument after command */
|
||||
if (argc > 1 &&
|
||||
@@ -785,6 +798,8 @@ static int version_func(struct nl_sock *sock, int argc, char ** argv)
|
||||
return ret;
|
||||
|
||||
if (argc > 1) {
|
||||
+ max_minor = get_max_minorversion();
|
||||
+
|
||||
for (i = 1; i < argc; ++i) {
|
||||
int ret, major, minor = 0;
|
||||
char sign = '\0', *str = argv[i];
|
||||
@@ -808,9 +823,22 @@ static int version_func(struct nl_sock *sock, int argc, char ** argv)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- ret = update_nfsd_version(major, minor, enabled);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
+ /*
|
||||
+ * The minorversion field is optional. If omitted, it should
|
||||
+ * cause all the minor versions for that major version to be
|
||||
+ * enabled/disabled.
|
||||
+ */
|
||||
+ if (major == 4 && ret == 2) {
|
||||
+ for (j = 0; j <= max_minor; ++j) {
|
||||
+ ret = update_nfsd_version(major, j, enabled);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
+ } else {
|
||||
+ ret = update_nfsd_version(major, minor, enabled);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
return set_nfsd_versions(sock);
|
||||
}
|
||||
@@ -1275,15 +1303,47 @@ read_nfsd_conf(void)
|
||||
xlog_set_debug("nfsd");
|
||||
}
|
||||
|
||||
-static void configure_versions(void)
|
||||
+static int configure_versions(void)
|
||||
{
|
||||
- bool v4 = conf_get_bool("nfsd", "vers4", true);
|
||||
+ int i, j, max_minor = get_max_minorversion();
|
||||
+ bool found_one = false;
|
||||
+ char tag[20];
|
||||
+
|
||||
+ for (i = 2; i <= 4; ++i) {
|
||||
+ sprintf(tag, "vers%d", i);
|
||||
+ if (!conf_get_bool("nfsd", tag, true)) {
|
||||
+ update_nfsd_version(i, 0, false);
|
||||
+ if (i == 4)
|
||||
+ for (j = 0; j <= max_minor; ++j)
|
||||
+ update_nfsd_version(4, j, false);
|
||||
+ }
|
||||
+ if (conf_get_bool("nfsd", tag, false)) {
|
||||
+ update_nfsd_version(i, 0, true);
|
||||
+ if (i == 4)
|
||||
+ for (j = 0; j <= max_minor; ++j)
|
||||
+ update_nfsd_version(4, j, true);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i <= max_minor; ++i) {
|
||||
+ sprintf(tag, "vers4.%d", i);
|
||||
+ if (!conf_get_bool("nfsd", tag, true))
|
||||
+ update_nfsd_version(4, i, false);
|
||||
+ if (conf_get_bool("nfsd", tag, false))
|
||||
+ update_nfsd_version(4, i, true);
|
||||
+ }
|
||||
|
||||
- update_nfsd_version(2, 0, conf_get_bool("nfsd", "vers2", false));
|
||||
- update_nfsd_version(3, 0, conf_get_bool("nfsd", "vers3", true));
|
||||
- update_nfsd_version(4, 0, v4 && conf_get_bool("nfsd", "vers4.0", true));
|
||||
- update_nfsd_version(4, 1, v4 && conf_get_bool("nfsd", "vers4.1", true));
|
||||
- update_nfsd_version(4, 2, v4 && conf_get_bool("nfsd", "vers4.2", true));
|
||||
+ for (i = 0; i < MAX_NFS_VERSIONS; ++i) {
|
||||
+ if (nfsd_versions[i].enabled) {
|
||||
+ found_one = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ if (!found_one) {
|
||||
+ xlog(L_ERROR, "no version specified");
|
||||
+ return 1;
|
||||
+ }
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static void configure_listeners(void)
|
||||
@@ -1367,7 +1427,9 @@ static int autostart_func(struct nl_sock *sock, int argc, char ** argv)
|
||||
ret = fetch_nfsd_versions(sock);
|
||||
if (ret)
|
||||
return ret;
|
||||
- configure_versions();
|
||||
+ ret = configure_versions();
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
ret = set_nfsd_versions(sock);
|
||||
if (ret)
|
||||
return ret;
|
||||
@ -0,0 +1,27 @@
|
||||
From ff2077d10ad11ad7422d1bb22f5761da6610ca38 Mon Sep 17 00:00:00 2001
|
||||
From: zhangyaqi <zhangyaqi@kylinos.cn>
|
||||
Date: Tue, 6 May 2025 11:53:59 -0400
|
||||
Subject: [nfs-utils PATCH 8/9] gssd:fix the possible buffer overflow in
|
||||
get_full_hostname
|
||||
|
||||
Signed-off-by: zhangyaqi <zhangyaqi@kylinos.cn>
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
---
|
||||
utils/gssd/krb5_util.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
|
||||
index 560e8be1..09625fb9 100644
|
||||
--- a/utils/gssd/krb5_util.c
|
||||
+++ b/utils/gssd/krb5_util.c
|
||||
@@ -619,6 +619,7 @@ get_full_hostname(const char *inhost, char *outhost, int outhostlen)
|
||||
goto out;
|
||||
}
|
||||
strncpy(outhost, addrs->ai_canonname, outhostlen);
|
||||
+ outhost[outhostlen - 1] = '\0';
|
||||
nfs_freeaddrinfo(addrs);
|
||||
for (c = outhost; *c != '\0'; c++)
|
||||
*c = tolower(*c);
|
||||
--
|
||||
2.48.1
|
||||
|
||||
26
nfs-utils-2.8.3-nfsdcld-Fix-a-memory-leak.patch
Normal file
26
nfs-utils-2.8.3-nfsdcld-Fix-a-memory-leak.patch
Normal file
@ -0,0 +1,26 @@
|
||||
From 211280c0e7d2d11e12124cd64e4e6d169b2f2b88 Mon Sep 17 00:00:00 2001
|
||||
From: zhangyaqi <zhangyaqi@kylinos.cn>
|
||||
Date: Tue, 6 May 2025 11:23:35 -0400
|
||||
Subject: [nfs-utils PATCH 7/9] nfsdcld:Fix a memory leak
|
||||
|
||||
Signed-off-by: zhangyaqi <zhangyaqi@kylinos.cn>
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
---
|
||||
utils/nfsdcld/nfsdcld.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/utils/nfsdcld/nfsdcld.c b/utils/nfsdcld/nfsdcld.c
|
||||
index f7737d92..8551dc97 100644
|
||||
--- a/utils/nfsdcld/nfsdcld.c
|
||||
+++ b/utils/nfsdcld/nfsdcld.c
|
||||
@@ -822,6 +822,7 @@ main(int argc, char **argv)
|
||||
evbase = event_base_new();
|
||||
if (evbase == NULL) {
|
||||
fprintf(stderr, "%s: unable to allocate event base.\n", argv[0]);
|
||||
+ free(progname);
|
||||
return 1;
|
||||
}
|
||||
xlog_syslog(0);
|
||||
--
|
||||
2.48.1
|
||||
|
||||
43
nfs-utils-2.8.3-nfsdctl-Warning-Clean-Up.patch
Normal file
43
nfs-utils-2.8.3-nfsdctl-Warning-Clean-Up.patch
Normal file
@ -0,0 +1,43 @@
|
||||
From 2cf015ea4312f37598efe9733fef3232ab67f784 Mon Sep 17 00:00:00 2001
|
||||
From: Steve Dickson <steved@redhat.com>
|
||||
Date: Wed, 7 May 2025 07:42:04 -0400
|
||||
Subject: [nfs-utils PATCH 9/9] nfsdctl: Warning Clean Up
|
||||
|
||||
Removed a number of unused variables
|
||||
|
||||
Initialized a variable that could be used
|
||||
before initialized
|
||||
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
---
|
||||
utils/nfsdctl/nfsdctl.c | 7 ++-----
|
||||
1 file changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/utils/nfsdctl/nfsdctl.c b/utils/nfsdctl/nfsdctl.c
|
||||
index c2e34260..e7a0e124 100644
|
||||
--- a/utils/nfsdctl/nfsdctl.c
|
||||
+++ b/utils/nfsdctl/nfsdctl.c
|
||||
@@ -1521,7 +1521,7 @@ static int configure_versions(void)
|
||||
|
||||
static int configure_listeners(void)
|
||||
{
|
||||
- char *port, *rdma_port;
|
||||
+ char *port, *rdma_port = NULL;
|
||||
bool rdma, udp, tcp;
|
||||
struct conf_list *hosts;
|
||||
int ret = 0;
|
||||
@@ -1675,10 +1675,7 @@ static void nlm_usage(void)
|
||||
|
||||
static int nlm_func(struct nl_sock *sock, int argc, char ** argv)
|
||||
{
|
||||
- int *threads, grace, lease, idx, ret, opt, pools;
|
||||
- struct conf_list *thread_str;
|
||||
- struct conf_list_node *n;
|
||||
- char *scope, *pool_mode;
|
||||
+ int opt;
|
||||
|
||||
optind = 1;
|
||||
while ((opt = getopt_long(argc, argv, "h", help_only_options, NULL)) != -1) {
|
||||
--
|
||||
2.48.1
|
||||
|
||||
61
nfs-utils-2.8.3-nfsdctl-debug-logging-fixups.patch
Normal file
61
nfs-utils-2.8.3-nfsdctl-debug-logging-fixups.patch
Normal file
@ -0,0 +1,61 @@
|
||||
From 6d1cdc66aa7a749535999b812b2a7f18594b2176 Mon Sep 17 00:00:00 2001
|
||||
From: Scott Mayhew <smayhew@redhat.com>
|
||||
Date: Tue, 6 May 2025 10:50:26 -0400
|
||||
Subject: [nfs-utils PATCH 5/9] nfsdctl: debug logging fixups
|
||||
|
||||
Move read_nfsd_conf() out of autostart_func() and into main() so we
|
||||
don't lose any messages. Remove hard-coded NFSD_FAMILY_NAME in the
|
||||
first error message in netlink_msg_alloc() so the error message has the
|
||||
correct family and make both error messages in netlink_msg_alloc()
|
||||
more descriptive/unique.
|
||||
|
||||
Reviewed-by: Jeff Layton <jlayton@kernel.org>
|
||||
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
---
|
||||
utils/nfsdctl/nfsdctl.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/utils/nfsdctl/nfsdctl.c b/utils/nfsdctl/nfsdctl.c
|
||||
index 733756a9..1fdbb44d 100644
|
||||
--- a/utils/nfsdctl/nfsdctl.c
|
||||
+++ b/utils/nfsdctl/nfsdctl.c
|
||||
@@ -436,7 +436,7 @@ static struct nl_msg *netlink_msg_alloc(struct nl_sock *sock, const char *family
|
||||
|
||||
id = genl_ctrl_resolve(sock, family);
|
||||
if (id < 0) {
|
||||
- xlog(L_ERROR, "%s not found", NFSD_FAMILY_NAME);
|
||||
+ xlog(L_ERROR, "failed to resolve %s generic netlink family", family);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -447,7 +447,7 @@ static struct nl_msg *netlink_msg_alloc(struct nl_sock *sock, const char *family
|
||||
}
|
||||
|
||||
if (!genlmsg_put(msg, 0, 0, id, 0, 0, 0, 0)) {
|
||||
- xlog(L_ERROR, "failed to allocate netlink message");
|
||||
+ xlog(L_ERROR, "failed to add generic netlink headers to netlink message");
|
||||
nlmsg_free(msg);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1592,8 +1592,6 @@ static int autostart_func(struct nl_sock *sock, int argc, char ** argv)
|
||||
}
|
||||
}
|
||||
|
||||
- read_nfsd_conf();
|
||||
-
|
||||
grace = conf_get_num("nfsd", "grace-time", 0);
|
||||
ret = lockd_configure(sock, grace);
|
||||
if (ret) {
|
||||
@@ -1824,6 +1822,8 @@ int main(int argc, char **argv)
|
||||
xlog_syslog(0);
|
||||
xlog_stderr(1);
|
||||
|
||||
+ read_nfsd_conf();
|
||||
+
|
||||
/* Parse the preliminary options */
|
||||
while ((opt = getopt_long(argc, argv, "+hdsV", pre_options, NULL)) != -1) {
|
||||
switch (opt) {
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
From c5b1a81310471927f0f42ae9b592c6e06ceb2793 Mon Sep 17 00:00:00 2001
|
||||
From: Scott Mayhew <smayhew@redhat.com>
|
||||
Date: Tue, 6 May 2025 10:53:14 -0400
|
||||
Subject: [nfs-utils PATCH 6/9] nfsdctl: fix lockd config during autostart
|
||||
|
||||
Be sure to actually send the lockd config values over the netlink
|
||||
interface.
|
||||
|
||||
While we're at it, get rid of the unused "ret" variable.
|
||||
|
||||
Fixes: f61c2ff8 ("nfsdctl: add necessary bits to configure lockd")
|
||||
Reviewed-by: Jeff Layton <jlayton@kernel.org>
|
||||
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
---
|
||||
utils/nfsdctl/nfsdctl.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/utils/nfsdctl/nfsdctl.c b/utils/nfsdctl/nfsdctl.c
|
||||
index 1fdbb44d..c2e34260 100644
|
||||
--- a/utils/nfsdctl/nfsdctl.c
|
||||
+++ b/utils/nfsdctl/nfsdctl.c
|
||||
@@ -1417,7 +1417,6 @@ static int lockd_configure(struct nl_sock *sock, int grace)
|
||||
{
|
||||
char *tcp_svc, *udp_svc;
|
||||
int tcpport = 0, udpport = 0;
|
||||
- int ret;
|
||||
|
||||
tcp_svc = conf_get_str("lockd", "port");
|
||||
if (tcp_svc) {
|
||||
@@ -1432,6 +1431,8 @@ static int lockd_configure(struct nl_sock *sock, int grace)
|
||||
if (udpport < 0)
|
||||
return 1;
|
||||
}
|
||||
+
|
||||
+ return lockd_config_doit(sock, LOCKD_CMD_SERVER_SET, grace, tcpport, udpport);
|
||||
}
|
||||
|
||||
static int
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@ -0,0 +1,69 @@
|
||||
From 94a12a1bdabe7acb86bc610c079945ffca01e036 Mon Sep 17 00:00:00 2001
|
||||
From: Anna Schumaker <anna.schumaker@oracle.com>
|
||||
Date: Tue, 6 May 2025 10:24:52 -0400
|
||||
Subject: [nfs-utils PATCH 4/9] rpcctl: Add support for `rpcctl switch
|
||||
add-xprt`
|
||||
|
||||
This is used to add an xprt to the switch at runtime.
|
||||
|
||||
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
---
|
||||
tools/rpcctl/rpcctl.man | 4 ++++
|
||||
tools/rpcctl/rpcctl.py | 11 +++++++++++
|
||||
2 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/tools/rpcctl/rpcctl.man b/tools/rpcctl/rpcctl.man
|
||||
index b87ba0df..2ee168c8 100644
|
||||
--- a/tools/rpcctl/rpcctl.man
|
||||
+++ b/tools/rpcctl/rpcctl.man
|
||||
@@ -12,6 +12,7 @@ rpcctl \- Displays SunRPC connection information
|
||||
.BR "rpcctl client show " "\fR[ \fB\-h \f| \fB\-\-help \fR] [ \fIXPRT \fR]"
|
||||
.P
|
||||
.BR "rpcctl switch" " \fR[ \fB\-h \fR| \fB\-\-help \fR] { \fBset \fR| \fBshow \fR}"
|
||||
+.BR "rpcctl switch add-xprt" " \fR[ \fB\-h \fR| \fB\-\-help \fR] [ \fISWITCH \fR]"
|
||||
.BR "rpcctl switch set" " \fR[ \fB\-h \fR| \fB\-\-help \fR] \fISWITCH \fBdstaddr \fINEWADDR"
|
||||
.BR "rpcctl switch show" " \fR[ \fB\-h \fR| \fB\-\-help \fR] [ \fISWITCH \fR]"
|
||||
.P
|
||||
@@ -29,6 +30,9 @@ Show detailed information about the RPC clients on this system.
|
||||
If \fICLIENT \fRwas provided, then only show information about a single RPC client.
|
||||
.P
|
||||
.SS rpcctl switch \fR- \fBCommands operating on groups of transports
|
||||
+.IP "\fBadd-xprt \fISWITCH"
|
||||
+Add an aditional transport to the \fISWITCH\fR.
|
||||
+Note that the new transport will take its values from the "main" transport.
|
||||
.IP "\fBset \fISWITCH \fBdstaddr \fINEWADDR"
|
||||
Change the destination address of all transports in the \fISWITCH \fRto \fINEWADDR\fR.
|
||||
\fINEWADDR \fRcan be an IP address, DNS name, or anything else resolvable by \fBgethostbyname\fR(3).
|
||||
diff --git a/tools/rpcctl/rpcctl.py b/tools/rpcctl/rpcctl.py
|
||||
index 130f245a..29ae7d26 100755
|
||||
--- a/tools/rpcctl/rpcctl.py
|
||||
+++ b/tools/rpcctl/rpcctl.py
|
||||
@@ -213,6 +213,12 @@ class XprtSwitch:
|
||||
parser.set_defaults(func=XprtSwitch.show, switch=None)
|
||||
subparser = parser.add_subparsers()
|
||||
|
||||
+ add = subparser.add_parser("add-xprt",
|
||||
+ help="Add an xprt to the switch")
|
||||
+ add.add_argument("switch", metavar="SWITCH", nargs=1,
|
||||
+ help="Name of a specific xprt switch to modify")
|
||||
+ add.set_defaults(func=XprtSwitch.add_xprt)
|
||||
+
|
||||
show = subparser.add_parser("show", help="Show xprt switches")
|
||||
show.add_argument("switch", metavar="SWITCH", nargs='?',
|
||||
help="Name of a specific switch to show")
|
||||
@@ -236,6 +242,11 @@ class XprtSwitch:
|
||||
return [XprtSwitch(xprt_switches / name)]
|
||||
return [XprtSwitch(f) for f in sorted(xprt_switches.iterdir())]
|
||||
|
||||
+ def add_xprt(args):
|
||||
+ """Handle the `rpcctl switch add-xprt` command."""
|
||||
+ for switch in XprtSwitch.get_by_name(args.switch[0]):
|
||||
+ write_sysfs_file(switch.path / "add_xprt", "1")
|
||||
+
|
||||
def show(args):
|
||||
"""Handle the `rpcctl switch show` command."""
|
||||
for switch in XprtSwitch.get_by_name(args.switch):
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@ -0,0 +1,57 @@
|
||||
From c2859c0738b2ba426ee7bec61a8a72a517483f09 Mon Sep 17 00:00:00 2001
|
||||
From: Anna Schumaker <anna.schumaker@oracle.com>
|
||||
Date: Tue, 6 May 2025 10:17:36 -0400
|
||||
Subject: [nfs-utils PATCH 2/9] rpcctl: Add support for the xprtsec sysfs
|
||||
attribute
|
||||
|
||||
This was recently added to the Linux kernel, so running rpcctl on
|
||||
kernels that don't have this attribute will print out "unknown" in its
|
||||
place instead.
|
||||
|
||||
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
---
|
||||
tools/rpcctl/rpcctl.py | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tools/rpcctl/rpcctl.py b/tools/rpcctl/rpcctl.py
|
||||
index 654b2f60..ce22e424 100755
|
||||
--- a/tools/rpcctl/rpcctl.py
|
||||
+++ b/tools/rpcctl/rpcctl.py
|
||||
@@ -20,13 +20,13 @@ if not sunrpc.is_dir():
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
-def read_sysfs_file(path):
|
||||
+def read_sysfs_file(path, *, missing="enoent"):
|
||||
"""Read a sysfs file."""
|
||||
try:
|
||||
with open(path, 'r') as f:
|
||||
return f.readline().strip()
|
||||
except FileNotFoundError:
|
||||
- return "(enoent)"
|
||||
+ return f"({missing})"
|
||||
|
||||
|
||||
def write_sysfs_file(path, input):
|
||||
@@ -58,6 +58,7 @@ class Xprt:
|
||||
self.info = read_info_file(path / "xprt_info")
|
||||
self.dstaddr = read_sysfs_file(path / "dstaddr")
|
||||
self.srcaddr = read_sysfs_file(path / "srcaddr")
|
||||
+ self.xprtsec = read_sysfs_file(path / "xprtsec", missing="unknown")
|
||||
self.read_state()
|
||||
|
||||
def __lt__(self, rhs):
|
||||
@@ -67,7 +68,8 @@ class Xprt:
|
||||
def _xprt(self):
|
||||
main = ", main" if self.info.get("main_xprt") else ""
|
||||
return f"{self.name}: {self.type}, {self.dstaddr}, " \
|
||||
- f"port {self.info['dst_port']}, state <{self.state}>{main}"
|
||||
+ f"port {self.info['dst_port']}, sec {self.xprtsec}, " \
|
||||
+ f"state <{self.state}>{main}"
|
||||
|
||||
def _src_reqs(self):
|
||||
return f" Source: {self.srcaddr}, port {self.info['src_port']}, " \
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
From 6ac06428e7fdedde90eefe446ae88a42714dc974 Mon Sep 17 00:00:00 2001
|
||||
From: Anna Schumaker <anna.schumaker@oracle.com>
|
||||
Date: Tue, 6 May 2025 10:21:42 -0400
|
||||
Subject: [nfs-utils PATCH 3/9] rpcctl: Display new rpc_clnt sysfs attributes
|
||||
|
||||
This includes the rpc program name, rpc version, and maximum number of
|
||||
connections.
|
||||
|
||||
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
---
|
||||
tools/rpcctl/rpcctl.py | 15 ++++++++++-----
|
||||
1 file changed, 10 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/tools/rpcctl/rpcctl.py b/tools/rpcctl/rpcctl.py
|
||||
index ce22e424..130f245a 100755
|
||||
--- a/tools/rpcctl/rpcctl.py
|
||||
+++ b/tools/rpcctl/rpcctl.py
|
||||
@@ -185,14 +185,13 @@ class Xprt:
|
||||
class XprtSwitch:
|
||||
"""Represents a group of xprt connections."""
|
||||
|
||||
- def __init__(self, path, sep=":"):
|
||||
+ def __init__(self, path):
|
||||
"""Read in xprt switch information from sysfs."""
|
||||
self.path = path
|
||||
self.name = path.stem
|
||||
self.info = read_info_file(path / "xprt_switch_info")
|
||||
self.xprts = sorted([Xprt(p) for p in self.path.iterdir()
|
||||
if p.is_dir()])
|
||||
- self.sep = sep
|
||||
|
||||
def __lt__(self, rhs):
|
||||
"""Compare the name of two xprt switch instances."""
|
||||
@@ -200,7 +199,7 @@ class XprtSwitch:
|
||||
|
||||
def __str__(self):
|
||||
"""Return a string representation of an xprt switch."""
|
||||
- switch = f"{self.name}{self.sep} " \
|
||||
+ switch = f"{self.name}: " \
|
||||
f"xprts {self.info['num_xprts']}, " \
|
||||
f"active {self.info['num_active']}, " \
|
||||
f"queue {self.info['queue_len']}"
|
||||
@@ -258,7 +257,11 @@ class RpcClient:
|
||||
"""Read in rpc client information from sysfs."""
|
||||
self.path = path
|
||||
self.name = path.stem
|
||||
- self.switch = XprtSwitch(path / (path / "switch").readlink(), sep=",")
|
||||
+ self.switch = XprtSwitch(path / (path / "switch").readlink())
|
||||
+ self.program = read_sysfs_file(path / "program", missing="unknown")
|
||||
+ self.version = read_sysfs_file(path / "rpc_version", missing="unknown")
|
||||
+ self.max_connect = read_sysfs_file(path / "max_connect",
|
||||
+ missing="unknown")
|
||||
|
||||
def __lt__(self, rhs):
|
||||
"""Compare the name of two rpc client instances."""
|
||||
@@ -266,7 +269,9 @@ class RpcClient:
|
||||
|
||||
def __str__(self):
|
||||
"""Return a string representation of an rpc client."""
|
||||
- return f"{self.name}: {self.switch}"
|
||||
+ return f"{self.name}: {self.program}, rpc version {self.version}, " \
|
||||
+ f"max_connect {self.max_connect}" \
|
||||
+ f"\n {' ' * len(self.name)}{self.switch}"
|
||||
|
||||
def add_command(subparser):
|
||||
"""Add parser options for the `rpcctl client` command."""
|
||||
--
|
||||
2.48.1
|
||||
|
||||
68
nfs-utils-2.8.3-rpcctl-Rename-read-write-_addr_file.patch
Normal file
68
nfs-utils-2.8.3-rpcctl-Rename-read-write-_addr_file.patch
Normal file
@ -0,0 +1,68 @@
|
||||
From c33753ce86a5f385fdb88c4d29530359b12f72c1 Mon Sep 17 00:00:00 2001
|
||||
From: Anna Schumaker <anna.schumaker@oracle.com>
|
||||
Date: Tue, 6 May 2025 10:15:45 -0400
|
||||
Subject: [nfs-utils PATCH 1/9] rpcctl: Rename {read,write}_addr_file()
|
||||
|
||||
There is nothing address specific about these functions, so name them
|
||||
something more generic so they can be reused.
|
||||
|
||||
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
---
|
||||
tools/rpcctl/rpcctl.py | 18 +++++++++---------
|
||||
1 file changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/tools/rpcctl/rpcctl.py b/tools/rpcctl/rpcctl.py
|
||||
index 0221fbb6..654b2f60 100755
|
||||
--- a/tools/rpcctl/rpcctl.py
|
||||
+++ b/tools/rpcctl/rpcctl.py
|
||||
@@ -20,8 +20,8 @@ if not sunrpc.is_dir():
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
-def read_addr_file(path):
|
||||
- """Read an xprt address file."""
|
||||
+def read_sysfs_file(path):
|
||||
+ """Read a sysfs file."""
|
||||
try:
|
||||
with open(path, 'r') as f:
|
||||
return f.readline().strip()
|
||||
@@ -29,11 +29,11 @@ def read_addr_file(path):
|
||||
return "(enoent)"
|
||||
|
||||
|
||||
-def write_addr_file(path, newaddr):
|
||||
- """Write a new address to an xprt address file."""
|
||||
+def write_sysfs_file(path, input):
|
||||
+ """Write 'input' to a sysfs file."""
|
||||
with open(path, 'w') as f:
|
||||
- f.write(newaddr)
|
||||
- return read_addr_file(path)
|
||||
+ f.write(input)
|
||||
+ return read_sysfs_file(path)
|
||||
|
||||
|
||||
def read_info_file(path):
|
||||
@@ -56,8 +56,8 @@ class Xprt:
|
||||
self.name = path.stem.rsplit("-", 1)[0]
|
||||
self.type = path.stem.split("-")[2]
|
||||
self.info = read_info_file(path / "xprt_info")
|
||||
- self.dstaddr = read_addr_file(path / "dstaddr")
|
||||
- self.srcaddr = read_addr_file(path / "srcaddr")
|
||||
+ self.dstaddr = read_sysfs_file(path / "dstaddr")
|
||||
+ self.srcaddr = read_sysfs_file(path / "srcaddr")
|
||||
self.read_state()
|
||||
|
||||
def __lt__(self, rhs):
|
||||
@@ -106,7 +106,7 @@ class Xprt:
|
||||
|
||||
def set_dstaddr(self, newaddr):
|
||||
"""Change the dstaddr of an xprt."""
|
||||
- self.dstaddr = write_addr_file(self.path / "dstaddr", newaddr)
|
||||
+ self.dstaddr = write_sysfs_file(self.path / "dstaddr", newaddr)
|
||||
|
||||
def set_state(self, state):
|
||||
"""Change the state of an xprt."""
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
Summary: NFS utilities and supporting clients and daemons for the kernel NFS server
|
||||
Name: nfs-utils
|
||||
URL: http://linux-nfs.org/
|
||||
Version: 2.8.2
|
||||
Release: 3%{?dist}
|
||||
Version: 2.8.3
|
||||
Release: 0%{?dist}
|
||||
Epoch: 1
|
||||
|
||||
# group all 32bit related archs
|
||||
@ -15,10 +15,17 @@ Source3: 24-nfs-server.conf
|
||||
Source4: 10-nfsv4.conf
|
||||
|
||||
#
|
||||
# RHEL10.0
|
||||
# RHEL 10.1
|
||||
#
|
||||
Patch001: nfs-utils-2.8.2-nfsdcltrack-cleanup.patch
|
||||
Patch002: nfs-utils-2.8.2-nfsdctl-nfsd-version-handling-fixes.patch
|
||||
Patch001: nfs-utils-2.8.3-rpcctl-Rename-read-write-_addr_file.patch
|
||||
Patch002: nfs-utils-2.8.3-rpcctl-Add-support-for-the-xprtsec-sysfs-attribute.patch
|
||||
Patch003: nfs-utils-2.8.3-rpcctl-Display-new-rpc_clnt-sysfs-attributes.patch
|
||||
Patch004: nfs-utils-2.8.3-rpcctl-Add-support-for-rpcctl-switch-add-xprt.patch
|
||||
Patch005: nfs-utils-2.8.3-nfsdctl-debug-logging-fixups.patch
|
||||
Patch006: nfs-utils-2.8.3-nfsdctl-fix-lockd-config-during-autostart.patch
|
||||
Patch007: nfs-utils-2.8.3-nfsdcld-Fix-a-memory-leak.patch
|
||||
Patch008: nfs-utils-2.8.3-gssd-fix-the-possible-buffer-overflow-in-get_full_ho.patch
|
||||
Patch009: nfs-utils-2.8.3-nfsdctl-Warning-Clean-Up.patch
|
||||
|
||||
Patch100: nfs-utils-1.2.1-statdpath-man.patch
|
||||
Patch102: nfs-utils-1.2.5-idmap-errmsg.patch
|
||||
@ -433,6 +440,15 @@ rm -rf /etc/systemd/system/rpc-*.requires
|
||||
%{_mandir}/*/nfsiostat.8.gz
|
||||
|
||||
%changelog
|
||||
* Tue Apr 29 2025 Scott Mayhew <smayhew@redhat.com> 2.8.3-0
|
||||
- Updated to nfs-utils-2-8-3 plus additional fixes from 2-8-4-rc1 (RHEL-88768)
|
||||
Resolves: RHEL-71286
|
||||
Resolves: RHEL-82418
|
||||
Resolves: RHEL-82557
|
||||
Resolves: RHEL-85409
|
||||
Resolves: RHEL-85413
|
||||
Resolves: RHEL-88768
|
||||
|
||||
* Wed Feb 5 2025 Scott Mayhew <smayhew@redhat.com> 2.8.2-3
|
||||
- fix ownership of /var/lib/nfs/statd/state (RHEL-77913)
|
||||
- /var/lib/nfs/{etab,rmtab} should not be marked as config files (RHEL-77912)
|
||||
|
||||
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (nfs-utils-2.8.2.tar.xz) = fff7122dde2f247afc2c4c066cbcf48447426ed9de9aaf2bbc8c445ac7f0e580e75011a479b3cb474bb7687dcd06f4f590c5e3bb2b40e7f3527d3445a6289bf4
|
||||
SHA512 (nfs-utils-2.8.3.tar.xz) = ed8ac3a79f347a1dc91cba060f87f687eefc204430648099ca867114295dd8dd8e745bd809807d5bc79dfb1ad86eaf2a6f4506ec7889c54b231d8f65dcb59bd4
|
||||
|
||||
Loading…
Reference in New Issue
Block a user