Index: vfs_vnode.c =================================================================== RCS file: /cvsroot/src/sys/kern/vfs_vnode.c,v retrieving revision 1.105.2.1 diff -u -p -r1.105.2.1 vfs_vnode.c --- vfs_vnode.c 8 Jan 2020 11:02:16 -0000 1.105.2.1 +++ vfs_vnode.c 15 Jan 2020 17:32:18 -0000 @@ -119,8 +119,7 @@ * Vnode finished disassociation from underlying file * system in vcache_reclaim(). * LOADED -> BLOCKED - * Either vcache_rekey*() is changing the vnode key or - * vrelel() is about to call VOP_INACTIVE(). + * vcache_rekey*() is changing the vnode key. * BLOCKED -> LOADED * The block condition is over. * LOADING -> RECLAIMED @@ -764,24 +763,22 @@ vrelel(vnode_t *vp, int flags) if (VSTATE_GET(vp) == VS_RECLAIMED) { VOP_UNLOCK(vp); } else { - VSTATE_CHANGE(vp, VS_LOADED, VS_BLOCKED); - mutex_exit(vp->v_interlock); - /* - * The vnode must not gain another reference while being - * deactivated. If VOP_INACTIVE() indicates that - * the described file has been deleted, then recycle - * the vnode. + * If VOP_INACTIVE() indicates that the described file has + * been deleted, then recycle the vnode. Note that + * VOP_INACTIVE() will not drop the vnode lock. * - * Note that VOP_INACTIVE() will not drop the vnode lock. + * If the file has been deleted, this is a lingering + * reference and there is no need to worry about new + * references looking to do real work with the vnode (as it + * will have been purged from directories, caches, etc). */ recycle = false; + mutex_exit(vp->v_interlock); VOP_INACTIVE(vp, &recycle); - if (!recycle) - VOP_UNLOCK(vp); mutex_enter(vp->v_interlock); - VSTATE_CHANGE(vp, VS_BLOCKED, VS_LOADED); if (!recycle) { + VOP_UNLOCK(vp); if (vp->v_usecount > 1) { vp->v_usecount--; mutex_exit(vp->v_interlock);