summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-12-22 15:15:29 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-12-22 15:15:29 +0000
commit957e12d9ffe5ff68adab535d762271df7e99ce63 (patch)
treeab31f0dd77ef9326f8b6f802d1e1bc2d3da187ac /sys
parent222ed302db3d9c29b5daaf246c025eb9845a9c7b (diff)
Release the NET_LOCK() before namei(9) as a workaround to let NFS boot
work without assert. ok visa@, bluhm@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_usrreq.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 1c0bc22e8e3..7f5b2abfe14 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_usrreq.c,v 1.106 2016/12/22 13:30:09 mpi Exp $ */
+/* $OpenBSD: uipc_usrreq.c,v 1.107 2016/12/22 15:15:28 mpi Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
/*
@@ -500,7 +500,22 @@ unp_connect(struct socket *so, struct mbuf *nam, struct proc *p)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, soun->sun_path, p);
nd.ni_pledge = PLEDGE_UNIX;
- if ((error = namei(&nd)) != 0)
+ /*
+ * XXXSMP breaks atomicity
+ *
+ * NFS might try to enter sosend(), at least during boot:
+ * sosend
+ * nfs_send
+ * nfs_request
+ * nfs_lookup
+ * VOP_LOOKUP
+ * vfs_lookup
+ * namei
+ */
+ rw_exit_write(&netlock);
+ error = namei(&nd);
+ rw_enter_write(&netlock);
+ if (error != 0)
return (error);
vp = nd.ni_vp;
if (vp->v_type != VSOCK) {