summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2000-11-09 17:23:39 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2000-11-09 17:23:39 +0000
commitaa59396b6c187bd76cb72e4f97fea63f58b025f0 (patch)
tree29b63b76c51c6a976f71f8ac1234fcbffd060017
parent650bd2314bebb15b4a77806ee7eebc696bad1c52 (diff)
PHOLD the nfsd.
PRELE the nfsiod when it exits (shouldn't be necessary to PHOLD it because it's a kernel thread, but it doesn't hurt.
-rw-r--r--sys/nfs/nfs_syscalls.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index e02ff9a9a3d..74769e1d1f0 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_syscalls.c,v 1.15 2000/05/24 17:41:12 mickey Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.16 2000/11/09 17:23:38 art Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
@@ -440,6 +440,7 @@ nfssvc_nfsd(nsd, argp, p)
TAILQ_INSERT_TAIL(&nfsd_head, nfsd, nfsd_chain);
nfs_numnfsd++;
}
+ PHOLD(p);
/*
* Loop getting rpc requests until SIGKILL.
*/
@@ -536,8 +537,10 @@ nfssvc_nfsd(nsd, argp, p)
nfsd->nfsd_authlen) &&
!copyout(nfsd->nfsd_verfstr, nsd->nsd_verfstr,
nfsd->nfsd_verflen) &&
- !copyout((caddr_t)nsd, argp, sizeof (*nsd)))
+ !copyout((caddr_t)nsd, argp, sizeof (*nsd))) {
+ PRELE(p);
return (ENEEDAUTH);
+ }
cacherep = RC_DROPIT;
} else
cacherep = nfsrv_getcache(nd, slp, &mreq);
@@ -679,6 +682,7 @@ nfssvc_nfsd(nsd, argp, p)
}
}
done:
+ PRELE(p);
TAILQ_REMOVE(&nfsd_head, nfsd, nfsd_chain);
splx(s);
free((caddr_t)nfsd, M_NFSD);
@@ -864,7 +868,7 @@ nfssvc_iod(p)
return (EBUSY);
nfs_asyncdaemon[myiod] = p;
nfs_numasync++;
- p->p_holdcnt++;
+ PHOLD(p);
/*
* Just loop around doin our stuff until SIGKILL
*/
@@ -912,6 +916,7 @@ nfssvc_iod(p)
} while ((bp = nbp) != NULL);
}
if (error) {
+ PRELE(p);
nfs_asyncdaemon[myiod] = NULL;
nfs_numasync--;
return (error);