--- kernel/bsd/nfs/nfs_node.c 2018/04/24 18:26:01 1.1.1.1 +++ kernel/bsd/nfs/nfs_node.c 2018/04/24 18:27:54 1.1.1.2 @@ -229,7 +229,6 @@ nfs_inactive(ap) register struct sillyrename *sp; struct proc *p = current_proc(); /* XXX */ extern int prtactive; - int active; struct ucred *cred; np = VTONFS(ap->a_vp); @@ -245,9 +244,11 @@ nfs_inactive(ap) /* * Remove the silly file that was rename'd earlier */ -#if DIAGNOSTIC - kprintf("nfs_inactive removing %s, dvp=%x, a_vp=%x, ap=%x, np=%x, sp=%x\n", &sp->s_name[0], (unsigned)sp->s_dvp, (unsigned)ap->a_vp, (unsigned)ap, (unsigned)np, (unsigned)sp); -#endif + NFS_DPF(SILLY, + ("nfs_inactive: %s, dvp=%x, a_vp=%x, ap=%x, np=%x, sp=%x\n", + &sp->s_name[0], (unsigned)sp->s_dvp, + (unsigned)ap->a_vp, (unsigned)ap, (unsigned)np, + (unsigned)sp)); /* * We get a reference (vget) to ensure getnewvnode() * doesn't recycle vp while we're asleep awaiting I/O. @@ -256,8 +257,9 @@ nfs_inactive(ap) * wont be zero and doing a vget would fail because * vclean holds VXLOCK. */ - active = ap->a_vp->v_usecount; - if (!active && vget(ap->a_vp, 0, ap->a_p)) + if (ap->a_vp->v_usecount > 0) { + VREF(ap->a_vp); + } else if (vget(ap->a_vp, 0, ap->a_p)) panic("nfs_inactive: vget failed"); (void) nfs_vinvalbuf(ap->a_vp, 0, sp->s_cred, p, 1); nfs_removeit(sp); @@ -268,8 +270,7 @@ nfs_inactive(ap) } vrele(sp->s_dvp); FREE_ZONE((caddr_t)sp, sizeof (struct sillyrename), M_NFSREQ); - if (!active) - vrele(ap->a_vp); + vrele(ap->a_vp); } np->n_flag &= (NMODIFIED | NFLUSHINPROG | NFLUSHWANT | NQNFSEVICTED | NQNFSNONCACHE | NQNFSWRITE);