1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Correct an error of omission in the reimplementation of the page

cache: vnode_pager_setsize() must handle the case where a file is
truncated to a non-page-size-aligned boundary and there is a cached
page underlying the new end of file.

Reported by:	kris, tegge
Tested by:	kris
MFC after:	3 days
This commit is contained in:
Alan Cox 2007-10-22 06:23:46 +00:00
parent 7b0e72d184
commit 0ab3c7a594
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=172875

View File

@ -426,6 +426,10 @@ vnode_pager_setsize(vp, nsize)
if (m->dirty != 0)
m->dirty = VM_PAGE_BITS_ALL;
vm_page_unlock_queues();
} else if ((nsize & PAGE_MASK) &&
__predict_false(object->cache != NULL)) {
vm_page_cache_free(object, OFF_TO_IDX(nsize),
nobjsize);
}
}
object->un_pager.vnp.vnp_size = nsize;