diff options
-rw-r--r-- | sys/kern/vfs_subr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 6ec9007..6e7a68c 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -772,6 +772,8 @@ getnewvnode(tag, mp, vops, vpp) panic("getnewvnode: free vnode isn't"); TAILQ_REMOVE(&vnode_free_list, vp, v_freelist); + if (vn_lock(vp, LK_EXCLUSIVE, td) != 0) + continue; /* * Don't recycle if we still have cached pages or if * we cannot get the interlock. @@ -783,8 +785,10 @@ getnewvnode(tag, mp, vops, vpp) TAILQ_INSERT_TAIL(&vnode_free_list, vp, v_freelist); vp = NULL; + VOP_UNLOCK(vp, 0, td); continue; } + VOP_UNLOCK(vp, 0, td); if (LIST_FIRST(&vp->v_cache_src)) { /* * note: nameileafonly sysctl is temporary, @@ -891,8 +895,6 @@ getnewvnode(tag, mp, vops, vpp) splx(s); - vfs_object_create(vp, td, td->td_ucred); - #if 0 vnodeallocs++; if (vnodeallocs % vnoderecycleperiod == 0 && |