diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 2c144ab17c2f..ecadcb7297aa 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3054,8 +3054,8 @@ vinactive(struct vnode *vp, struct thread *td) * point that VOP_INACTIVE() is called, there could still be * pending I/O and dirty pages in the object. */ - obj = vp->v_object; - if (obj != NULL && (obj->flags & OBJ_MIGHTBEDIRTY) != 0) { + if ((obj = vp->v_object) != NULL && (vp->v_vflag & VV_NOSYNC) == 0 && + (obj->flags & OBJ_MIGHTBEDIRTY) != 0) { VM_OBJECT_WLOCK(obj); vm_object_page_clean(obj, 0, 0, 0); VM_OBJECT_WUNLOCK(obj); diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index fa197214296e..fe015bdb8776 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1083,8 +1083,8 @@ vm_object_sync(vm_object_t object, vm_ooffset_t offset, vm_size_t size, * I/O. */ if (object->type == OBJT_VNODE && - (object->flags & OBJ_MIGHTBEDIRTY) != 0) { - vp = object->handle; + (object->flags & OBJ_MIGHTBEDIRTY) != 0 && + ((vp = object->handle)->v_vflag & VV_NOSYNC) == 0) { VM_OBJECT_WUNLOCK(object); (void) vn_start_write(vp, &mp, V_WAIT); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);