Correct a long-standing race condition in vm_fault() that could result in a

panic "vm_page_cache: caching a dirty page, ...": Access to the page must
be restricted or removed before calling vm_page_cache().  This race
condition is identical in nature to that which was addressed by
vm_pageout.c's revision 1.251 and vm_page.c's revision 1.275.

Reviewed by:	tegge
MFC after:	7 days
This commit is contained in:
Alan Cox 2004-02-15 00:42:26 +00:00
parent 862bba7a70
commit c6d9ef2e1f

View File

@ -488,10 +488,8 @@ readrest:
mt->hold_count ||
mt->wire_count)
continue;
if (mt->dirty == 0)
vm_page_test_dirty(mt);
pmap_remove_all(mt);
if (mt->dirty) {
pmap_remove_all(mt);
vm_page_deactivate(mt);
} else {
vm_page_cache(mt);