diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index a3a90c6dcce1..ceee8f5a14ea 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -1287,9 +1287,11 @@ vm_fault_copy_entry(vm_map_t dst_map, vm_map_t src_map, access &= ~VM_PROT_WRITE; /* - * Loop through all of the pages in the entry's range, copying each - * one from the source object (it should be there) to the destination - * object. + * Loop through all of the pages in the entry's range, copying + * each one from the source object (it should be there) to the + * destination object. Note that copied pages are not wired + * and marked dirty to prevent reclamation without saving the + * content into the swap file on pageout. */ for (vaddr = dst_entry->start, dst_pindex = 0; vaddr < dst_entry->end; @@ -1332,6 +1334,7 @@ vm_fault_copy_entry(vm_map_t dst_map, vm_map_t src_map, pmap_copy_page(src_m, dst_m); VM_OBJECT_UNLOCK(object); dst_m->valid = VM_PAGE_BITS_ALL; + dst_m->dirty = VM_PAGE_BITS_ALL; VM_OBJECT_UNLOCK(dst_object); /*