summaryrefslogtreecommitdiff
path: root/sys/nfs
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2022-05-22 04:52:18 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2022-05-22 04:52:18 +0000
commit7072ede104f6796dbf98196cab8bfb012a5b4fb1 (patch)
treed3f8139e15c9b59b873940f28a06f30569ed1111 /sys/nfs
parent35dc8c4704a1cbb7764899b866cdd81699d87368 (diff)
Lock kernel in nfsrv_rcv() because NFS subsystem is not MP-safe yet.
Tested in snaps for a week. OK bluhm@
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_socket.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index a20986e4a81..aa93938383d 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_socket.c,v 1.140 2022/03/17 14:23:34 visa Exp $ */
+/* $OpenBSD: nfs_socket.c,v 1.141 2022/05/22 04:52:17 visa Exp $ */
/* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */
/*
@@ -1561,8 +1561,10 @@ nfsrv_rcv(struct socket *so, caddr_t arg, int waitflag)
struct uio auio;
int flags, error;
+ KERNEL_LOCK();
+
if ((slp->ns_flag & SLP_VALID) == 0)
- return;
+ goto out;
/* Defer soreceive() to an nfsd. */
if (waitflag == M_DONTWAIT) {
@@ -1644,6 +1646,9 @@ dorecs:
if (waitflag == M_DONTWAIT &&
(slp->ns_rec || (slp->ns_flag & (SLP_NEEDQ | SLP_DISCONN))))
nfsrv_wakenfsd(slp);
+
+out:
+ KERNEL_UNLOCK();
}
/*