mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 05:05:08 +00:00
Kernel: Assert if rounding-up-to-page-size would wrap around to 0
If we try to align a number above 0xfffff000 to the next multiple of the page size (4 KiB), it would wrap around to 0. This is most likely never what we want, so let's assert if that happens.
This commit is contained in:
parent
198d641808
commit
09b1b09c19
19 changed files with 67 additions and 40 deletions
|
@ -77,7 +77,7 @@ void InodeVMObject::inode_size_changed(Badge<Inode>, size_t old_size, size_t new
|
|||
|
||||
InterruptDisabler disabler;
|
||||
|
||||
auto new_page_count = PAGE_ROUND_UP(new_size) / PAGE_SIZE;
|
||||
auto new_page_count = page_round_up(new_size) / PAGE_SIZE;
|
||||
m_physical_pages.resize(new_page_count);
|
||||
|
||||
m_dirty_pages.grow(new_page_count, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue