diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index 8c67a59eddb5..4008178f0297 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -346,6 +346,10 @@ mappedwrite(vnode_t *vp, int nbytes, uio_t *uio, dmu_tx_t *tx) VM_OBJECT_LOCK(obj); vm_page_wakeup(m); } else { + if (__predict_false(obj->cache != NULL)) { + vm_page_cache_free(obj, OFF_TO_IDX(start), + OFF_TO_IDX(start) + 1); + } dirbytes += bytes; } len -= bytes; diff --git a/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index 8c67a59eddb5..4008178f0297 100644 --- a/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -346,6 +346,10 @@ mappedwrite(vnode_t *vp, int nbytes, uio_t *uio, dmu_tx_t *tx) VM_OBJECT_LOCK(obj); vm_page_wakeup(m); } else { + if (__predict_false(obj->cache != NULL)) { + vm_page_cache_free(obj, OFF_TO_IDX(start), + OFF_TO_IDX(start) + 1); + } dirbytes += bytes; } len -= bytes;