1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

Kernel: The inode fault handler should grab the VMObject lock earlier

It doesn't look healthy to create raw references into an array before
a temporary unlock. In fact, that temporary unlock looks generally
unhealthy, but it's a different problem.
This commit is contained in:
Andreas Kling 2020-02-08 12:54:06 +01:00
parent a9d7902bb7
commit 00d8ec3ead

View file

@ -433,13 +433,14 @@ PageFaultResponse Region::handle_inode_fault(size_t page_index_in_region)
{
ASSERT_INTERRUPTS_DISABLED();
ASSERT(vmobject().is_inode());
auto& inode_vmobject = static_cast<InodeVMObject&>(vmobject());
auto& vmobject_physical_page_entry = inode_vmobject.physical_pages()[first_page_index() + page_index_in_region];
sti();
LOCKER(vmobject().m_paging_lock);
cli();
auto& inode_vmobject = static_cast<InodeVMObject&>(vmobject());
auto& vmobject_physical_page_entry = inode_vmobject.physical_pages()[first_page_index() + page_index_in_region];
#ifdef PAGE_FAULT_DEBUG
dbg() << "Inode fault in " << name() << " page index: " << page_index_in_region;
#endif