From 28e2e6f950d1ba5f61960c48a265075cb12ef497 Mon Sep 17 00:00:00 2001 From: alc Date: Sun, 22 Feb 2004 03:36:51 +0000 Subject: [PATCH] Correct a long-standing race condition in vm_object_page_remove() that could result in a dirty page being unintentionally freed. Reviewed by: tegge MFC after: 7 days --- sys/vm/vm_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 052f5fe10226..116a075e8e8a 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1797,7 +1797,7 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end, if (vm_page_sleep_if_busy(p, TRUE, "vmopar")) goto again; if (clean_only && p->valid) { - vm_page_test_dirty(p); + pmap_page_protect(p, VM_PROT_READ | VM_PROT_EXECUTE); if (p->valid & p->dirty) continue; }