aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2023-02-22 21:19:07 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2023-05-24 02:07:39 +0000
commit4ce0e24735a1619f54a22b263518e671256aef7e (patch)
tree93be791d77911bb35983b42a8aa2fc8d1a234180
parentc7f6408f482059d4fb7e5344b49a8d879da73743 (diff)
downloadsrc-4ce0e24735a1619f54a22b263518e671256aef7e.tar.gz
src-4ce0e24735a1619f54a22b263518e671256aef7e.zip
nfsd: Return ENXIO instead of EPERM when nfsd(8) already running
The nfsd(8) daemon generates an error message that does not indicate that the nfsd daemon is already running when the nfssvc(2) syscall fails for the NFSSVC_STABLERESTART. Also, the check for running nfsd(8) in a vnet prison will return EPERM when it fails. This patch replaces EPERM with ENXIO so that the nfsd(8) daemon can generate more reasonable failure messages. The nfsd(8) daemon will be patched in a future commit. (cherry picked from commit 10dff9da9748b0eadd2d02dded3afd2321d15537)
-rw-r--r--sys/fs/nfsserver/nfs_nfsdport.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index a5fcf58b3d9f..06e6a4147f30 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -4018,7 +4018,7 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *uap, struct ucred *cred)
if (!error && (NFSFPFLAG(fp) & (FREAD | FWRITE)) != (FREAD | FWRITE))
error = EBADF;
if (!error && NFSD_VNET(nfsrv_numnfsd) != 0)
- error = EPERM;
+ error = ENXIO;
if (!error) {
NFSD_VNET(nfsrv_stablefirst).nsf_fp = fp;
nfsrv_setupstable(p);