summaryrefslogtreecommitdiffstats
path: root/sys/nfs
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-12-23 07:54:13 +0000
committertedu <tedu@openbsd.org>2014-12-23 07:54:13 +0000
commit83c1d9fd7c5221fda06b24f6a3f78225de7da775 (patch)
tree7692307e921bd0ba7e204af797cf6bff2ae01526 /sys/nfs
parentchange pmap pools from nointr to waitok. pvpool left alone for now. (diff)
downloadwireguard-openbsd-83c1d9fd7c5221fda06b24f6a3f78225de7da775.tar.xz
wireguard-openbsd-83c1d9fd7c5221fda06b24f6a3f78225de7da775.zip
to be safe, revert locking change until further tested.
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_node.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c
index 0a63a744d7c..4d9bbd1d971 100644
--- a/sys/nfs/nfs_node.c
+++ b/sys/nfs/nfs_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_node.c,v 1.60 2014/12/23 04:48:47 tedu Exp $ */
+/* $OpenBSD: nfs_node.c,v 1.61 2014/12/23 07:54:13 tedu Exp $ */
/* $NetBSD: nfs_node.c,v 1.16 1996/02/18 11:53:42 fvdl Exp $ */
/*
@@ -118,27 +118,23 @@ loop:
*/
rw_exit_write(&nfs_hashlock);
error = getnewvnode(VT_NFS, mnt, &nfs_vops, &nvp);
+ /* note that we don't have this vnode set up completely yet */
+ rw_enter_write(&nfs_hashlock);
if (error) {
*npp = NULL;
+ rw_exit_write(&nfs_hashlock);
return (error);
}
- /* grab one of these too while we're outside the lock */
- np2 = pool_get(&nfs_node_pool, PR_WAITOK | PR_ZERO);
-
- /* note that we don't have this vnode set up completely yet */
- rw_enter_write(&nfs_hashlock);
nvp->v_flag |= VLARVAL;
np = RB_FIND(nfs_nodetree, &nmp->nm_ntree, &find);
- /* lost race. undo and repeat */
if (np != NULL) {
- pool_put(&nfs_node_pool, np2);
vgone(nvp);
rw_exit_write(&nfs_hashlock);
goto loop;
}
vp = nvp;
- np = np2;
+ np = pool_get(&nfs_node_pool, PR_WAITOK | PR_ZERO);
vp->v_data = np;
/* we now have an nfsnode on this vnode */
vp->v_flag &= ~VLARVAL;