summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/vfs_hash.c')
-rw-r--r--sys/kern/vfs_hash.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/vfs_hash.c b/sys/kern/vfs_hash.c
index 43d945e..5b77b1f 100644
--- a/sys/kern/vfs_hash.c
+++ b/sys/kern/vfs_hash.c
@@ -102,6 +102,8 @@ vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, stru
struct vnode *vp2;
int error;
+ lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL, td);
+ *vpp = NULL;
while (1) {
mtx_lock(&vfs_hash_mtx);
LIST_FOREACH(vp2,
@@ -132,7 +134,6 @@ vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, stru
vp->v_iflag |= VI_HASHED;
VI_UNLOCK(vp);
mtx_unlock(&vfs_hash_mtx);
- *vpp = NULL;
return (0);
}
OpenPOWER on IntegriCloud