From: visa Date: Sun, 22 May 2022 04:52:17 +0000 (+0000) Subject: Lock kernel in nfsrv_rcv() because NFS subsystem is not MP-safe yet. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=875ec42d701d81b9bd98b0f1a04b393f79028892;p=openbsd Lock kernel in nfsrv_rcv() because NFS subsystem is not MP-safe yet. Tested in snaps for a week. OK bluhm@ --- 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(); } /*