Fix two nfs-utils bugs

- nfsd: don't assume service is running when setting thread count to 0 (RHEL-174806)
- Pass ignore_hosts to export_create() in export_read() (RHEL-223703)

Resolves: RHEL-174806
Resolves: RHEL-223703
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
This commit is contained in:
Scott Mayhew 2026-08-03 13:44:06 -04:00
parent c315066da8
commit ee7cf13d80
3 changed files with 98 additions and 1 deletions

View File

@ -0,0 +1,46 @@
From 6eca2e72a5e9d9a4a576b947b93fd631c9975378 Mon Sep 17 00:00:00 2001
From: Scott Mayhew <smayhew@redhat.com>
Date: Wed, 15 Jul 2026 06:50:09 -0400
Subject: [nfs-utils PATCH] Pass ignore_hosts to export_create() in
export_read()
Commit 8f3d12ce ("nfs-server-generator: avoid using external services.")
added the 'ignore_hosts' flag to export_read() so nfs-server-generator
can bypass DNS queries when calling it. If the export doesn't
already exist, export_read() calls export_create() with the 'canonical'
argument hard-coded to 0, triggering a DNS query in client_lookup().
An unresponsive DNS server can cause delays in nfs-server-generator and
can even lead to 'systemctl daemon-reload' timing out, leading to
further administrative issues.
nfs-server-generator only cares about *what* is exported, so it can
create the order-with-mounts.conf config drop-in. It doesn't need to
know *who* those filesystems are exported to, so it has no need to
perform DNS queries.
Pass the 'ignore_hosts' flag from export_read() to export_create() to
avoid the unnecessary DNS queries.
Fixes: 8f3d12ce ("nfs-server-generator: avoid using external services.")
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
support/export/export.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/support/export/export.c b/support/export/export.c
index 2c8c3335..3caee043 100644
--- a/support/export/export.c
+++ b/support/export/export.c
@@ -122,7 +122,7 @@ export_read(char *fname, int ignore_hosts)
while ((eep = getexportent(0)) != NULL) {
exp = export_lookup(eep->e_hostname, eep->e_path, ignore_hosts);
if (!exp) {
- if (export_create(eep, 0))
+ if (export_create(eep, ignore_hosts))
/* possible complaints already logged */
volumes++;
}
--
2.55.0

View File

@ -0,0 +1,45 @@
From e4342316f4c93e88cce1382560c36dafbf4df58e Mon Sep 17 00:00:00 2001
From: Scott Mayhew <smayhew@redhat.com>
Date: Tue, 16 Jun 2026 06:57:20 -0400
Subject: [nfs-utils PATCH] nfsd: don't assume service is running when setting
thread count to 0
Newer kernels return -EIO if you try to write to /proc/fs/nfsd/threads
and there are no active listeners.
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/nfsd/nfsd.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index 365e145d..c95d32f4 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -311,12 +311,16 @@ main(int argc, char **argv)
argv[0], count);
count = 1;
} else if (count == 0) {
- /*
- * don't bother setting anything else if the threads
- * are coming down anyway.
- */
- socket_up = 1;
- goto set_threads;
+ if (nfssvc_inuse()) {
+ /*
+ * don't bother setting anything else if the threads
+ * are coming down anyway.
+ */
+ socket_up = 1;
+ goto set_threads;
+ } else {
+ goto out;
+ }
}
}
--
2.55.0

View File

@ -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.8.3
Release: 8%{?dist}
Release: 9%{?dist}
Epoch: 1
# group all 32bit related archs
@ -47,6 +47,8 @@ Patch019: nfs-utils-2.8.3-nfsdclnts-fix-display-of-stateids-where-the-kernel-d.p
Patch020: nfs-utils-2.8.3-nfsrahead-enable-event-driven-mountinfo-monitoring-a.patch
Patch021: nfs-utils-2.8.3-nfsrahead-zero-initialise-device_info-struct.patch
Patch022: nfs-utils-2.8.3-nfsrahead-quieten-misleading-error-for-non-NFS-block.patch
Patch023: nfs-utils-2.8.3-nfsd-don-t-assume-service-is-running-when-setting-th.patch
Patch024: nfs-utils-2.8.3-Pass-ignore_hosts-to-export_create-in-export_read.patch
Patch100: nfs-utils-1.2.1-statdpath-man.patch
Patch102: nfs-utils-1.2.5-idmap-errmsg.patch
@ -465,6 +467,10 @@ rm -rf /etc/systemd/system/rpc-*.requires
%{_mandir}/*/nfsiostat.8.gz
%changelog
* Mon Aug 3 2026 Scott Mayhew <smayhew@redhat.com> 2.8.3-9
- nfsd: don't assume service is running when setting thread count to 0 (RHEL-174806)
- Pass ignore_hosts to export_create() in export_read() (RHEL-223703)
* Wed Jul 1 2026 Scott Mayhew <smayhew@redhat.com> 2.8.3-8
- Ensure services are stopped when nfs-utils is uninstalled (RHEL-186341)