Index: sys/fs/nullfs/null_vnops.c =================================================================== --- sys/fs/nullfs/null_vnops.c +++ sys/fs/nullfs/null_vnops.c @@ -644,10 +644,10 @@ int error; - if ((flags & LK_INTERLOCK) == 0) { + if ((flags & LK_INTERLOCK) == 0) VI_LOCK(vp); - ap->a_flags = flags |= LK_INTERLOCK; - } + else + flags &= ~LK_INTERLOCK; nn = VTONULL(vp); /* * If we're still active we must ask the lower layer to @@ -655,8 +655,6 @@ * vop lock. */ if (nn != NULL && (lvp = NULLVPTOLOWERVP(vp)) != NULL) { - VI_LOCK_FLAGS(lvp, MTX_DUPOK); - VI_UNLOCK(vp); /* * We have to hold the vnode here to solve a potential * reclaim race. If we're forcibly vgone'd while we @@ -669,6 +667,7 @@ * here. */ vholdnz(lvp); + VI_UNLOCK(vp); error = VOP_LOCK(lvp, flags); /* @@ -695,8 +694,10 @@ error = vop_stdlock(ap); } vdrop(lvp); - } else + } else { + VI_UNLOCK(vp); error = vop_stdlock(ap); + } return (error); }