NFSD: fix up error returned by write_threads()

Previously, writing 0 to /proc/fs/nfsd/threads would return 0 if the
NFS server wasn't running.  After commit 14282cc3cf ("NFSD: don't
start nfsd if sv_permsocks is empty"), -EIO is returned. Existing
scripts don't expect this behavior.

Add a check to bypass the call to nfsd_svc() when newthreads is 0 and
the NFS server is already stopped.

Fixes: 14282cc3cf ("NFSD: don't start nfsd if sv_permsocks is empty")
Cc: stable@vger.kernel.org
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20260608131402.95625-1-smayhew@redhat.com
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
Scott Mayhew 2026-06-08 09:14:02 -04:00 • committed by Chuck Lever
commit 75e620912c