diff options
-rw-r--r-- | sys/kern/vfs_subr.c | 2 | ||||
-rw-r--r-- | sys/vm/vnode_pager.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 240f3ce..3c578d5 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1171,8 +1171,10 @@ vinvalbuf(vp, flags, cred, td, slpflag, slptimeo) * Destroy the copy in the VM cache, too. */ if (VOP_GETVOBJECT(vp, &object) == 0) { + vm_object_lock(object); vm_object_page_remove(object, 0, 0, (flags & V_SAVE) ? TRUE : FALSE); + vm_object_unlock(object); } #ifdef INVARIANTS diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 3a8d8bd..cf98090 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -311,8 +311,10 @@ vnode_pager_setsize(vp, nsize) vm_freeze_copyopts(object, OFF_TO_IDX(nsize), object->size); #endif if (nobjsize < object->size) { + vm_object_lock(object); vm_object_page_remove(object, nobjsize, object->size, FALSE); + vm_object_unlock(object); } /* * this gets rid of garbage at the end of a page that is now |