Index: sys/kern/vfs_subr.c =================================================================== --- sys/kern/vfs_subr.c +++ sys/kern/vfs_subr.c @@ -4340,34 +4340,33 @@ { struct vnode *vp, *mvp; struct vm_object *obj; + struct thread *td; CTR2(KTR_VFS, "%s: mp %p", __func__, mp); if ((mp->mnt_kern_flag & MNTK_NOMSYNC) != 0) return; + td = curthread; MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) { obj = vp->v_object; if (obj != NULL && vm_object_mightbedirty(obj) && (flags == MNT_WAIT || VOP_ISLOCKED(vp) == 0)) { - if (!vget(vp, - LK_EXCLUSIVE | LK_RETRY | LK_INTERLOCK, - curthread)) { - if (vp->v_vflag & VV_NOSYNC) { /* unlinked */ - vput(vp); - continue; - } - - obj = vp->v_object; - if (obj != NULL) { - VM_OBJECT_WLOCK(obj); - vm_object_page_clean(obj, 0, 0, - flags == MNT_WAIT ? - OBJPC_SYNC : OBJPC_NOSYNC); - VM_OBJECT_WUNLOCK(obj); - } + vget(vp, LK_EXCLUSIVE | LK_RETRY | LK_INTERLOCK, td); + if (vp->v_vflag & VV_NOSYNC) { /* unlinked */ vput(vp); + continue; + } + + obj = vp->v_object; + if (obj != NULL) { + VM_OBJECT_WLOCK(obj); + vm_object_page_clean(obj, 0, 0, + flags == MNT_WAIT ? + OBJPC_SYNC : OBJPC_NOSYNC); + VM_OBJECT_WUNLOCK(obj); } + vput(vp); } else VI_UNLOCK(vp); }