summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-02-20 14:21:58 +0000
committerdg <dg@FreeBSD.org>1995-02-20 14:21:58 +0000
commit2095f1db10e14e3e97d9cbf58eaef6bd4df837d3 (patch)
tree529d15f22ad32830996919adf72372c9f3454aa6
parent9d3b976e15ac19cac1e92ea5712f410b33b3988a (diff)
downloadFreeBSD-src-2095f1db10e14e3e97d9cbf58eaef6bd4df837d3.zip
FreeBSD-src-2095f1db10e14e3e97d9cbf58eaef6bd4df837d3.tar.gz
Panic if object is deallocated too many times.
Slight change to reverse collapsing so that vm_object_deallocate doesn't have to be called recursively. Removed half of a previous fix - the renamed page during a collapse doesn't need to be marked dirty because the pager backing store pointers are copied - thus preserving the page's data. This assumes that pages without backing store are always dirty (except perhaps for when they are first zeroed, but this doesn't matter). Switch order of two lines of code so that the correct pager is removed from the hash list. The previous code bogusly passed a NULL pointer to vm_object_remove(). The call to vm_object_remove() should be unnecessary if named anonymous objects were being dealt with correctly. They are currently marked as OBJ_INTERNAL, which really screws up things (such as this).
-rw-r--r--sys/vm/vm_object.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 6db081a..29162f8 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_object.c,v 1.22 1995/02/12 09:19:44 davidg Exp $
+ * $Id: vm_object.c,v 1.23 1995/02/18 06:48:33 davidg Exp $
*/
/*
@@ -245,6 +245,9 @@ vm_object_deallocate(object)
while (object != NULL) {
+ if (object->ref_count == 0)
+ panic("vm_object_deallocate: object deallocated too many times");
+
/*
* The cache holds a reference (uncounted) to the object; we
* must lock it before removing the object.
@@ -284,8 +287,8 @@ vm_object_deallocate(object)
vm_object_unlock(object);
vm_object_cache_unlock();
robject->ref_count += 1;
- vm_object_deallocate(robject);
- return;
+ object = robject;
+ continue;
}
vm_object_cache_unlock();
vm_object_unlock(object);
@@ -1377,7 +1380,6 @@ vm_object_collapse(object)
vm_page_unlock_queues();
} else {
vm_page_rename(p, object, new_offset);
- p->dirty = VM_PAGE_BITS_ALL;
}
}
}
@@ -1398,8 +1400,8 @@ vm_object_collapse(object)
* shadow object.
*/
bopager = backing_object->pager;
- backing_object->pager = NULL;
vm_object_remove(backing_object->pager);
+ backing_object->pager = NULL;
swap_pager_copy(
bopager, backing_object->paging_offset,
object->pager, object->paging_offset,
OpenPOWER on IntegriCloud