summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r--sys/vm/vm_map.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 9b863de..97d7c6d 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -2265,7 +2265,9 @@ vm_map_copy_entry(
}
vm_object_reference(src_object);
+ vm_object_lock(src_object);
vm_object_clear_flag(src_object, OBJ_ONEMAPPING);
+ vm_object_unlock(src_object);
dst_entry->object.vm_object = src_object;
src_entry->eflags |= (MAP_ENTRY_COW|MAP_ENTRY_NEEDS_COPY);
dst_entry->eflags |= (MAP_ENTRY_COW|MAP_ENTRY_NEEDS_COPY);
@@ -2355,7 +2357,9 @@ vmspace_fork(struct vmspace *vm1)
vm_object_deallocate(object);
object = old_entry->object.vm_object;
}
+ vm_object_lock(object);
vm_object_clear_flag(object, OBJ_ONEMAPPING);
+ vm_object_unlock(object);
/*
* Clone the entry, referencing the shared object.
OpenPOWER on IntegriCloud