Kernel: Fix oversized InodeVMObject after inode size changes

This commit is contained in:
Andreas Kling 2019-08-24 19:33:51 +02:00
parent 9bd68b189e
commit b018cd653f
Notes: sideshowbarker 2024-07-19 12:33:22 +09:00

View File

@ -43,7 +43,7 @@ void InodeVMObject::inode_size_changed(Badge<Inode>, size_t old_size, size_t new
InterruptDisabler disabler; InterruptDisabler disabler;
auto new_page_count = PAGE_ROUND_UP(new_size); auto new_page_count = PAGE_ROUND_UP(new_size) / PAGE_SIZE;
m_physical_pages.resize(new_page_count); m_physical_pages.resize(new_page_count);
// FIXME: Consolidate with inode_contents_changed() so we only do a single walk. // FIXME: Consolidate with inode_contents_changed() so we only do a single walk.