[Midnightbsd-cvs] src [9091] trunk/sys/vm/vm_map.c: fixx the asertions of the state of the object under the map entry with MAP_ENTRY_VN_WRITECNT

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Oct 1 06:34:15 EDT 2016


Revision: 9091
          http://svnweb.midnightbsd.org/src/?rev=9091
Author:   laffer1
Date:     2016-10-01 06:34:15 -0400 (Sat, 01 Oct 2016)
Log Message:
-----------
fixx the asertions of the state of the object under the map entry with MAP_ENTRY_VN_WRITECNT

Modified Paths:
--------------
    trunk/sys/vm/vm_map.c

Modified: trunk/sys/vm/vm_map.c
===================================================================
--- trunk/sys/vm/vm_map.c	2016-10-01 10:33:35 UTC (rev 9090)
+++ trunk/sys/vm/vm_map.c	2016-10-01 10:34:15 UTC (rev 9091)
@@ -3161,6 +3161,22 @@
 				object->charge = old_entry->end - old_entry->start;
 				old_entry->cred = NULL;
 			}
+
+			/*
+			 * Assert the correct state of the vnode
+			 * v_writecount while the object is locked, to
+			 * not relock it later for the assertion
+			 * correctness.
+			 */
+			if (old_entry->eflags & MAP_ENTRY_VN_WRITECNT &&
+			    object->type == OBJT_VNODE) {
+				KASSERT(((struct vnode *)object->handle)->
+				    v_writecount > 0,
+				    ("vmspace_fork: v_writecount %p", object));
+				KASSERT(object->un_pager.vnp.writemappings > 0,
+				    ("vmspace_fork: vnp.writecount %p",
+				    object));
+			}
 			VM_OBJECT_UNLOCK(object);
 
 			/*
@@ -3172,12 +3188,6 @@
 			    MAP_ENTRY_IN_TRANSITION);
 			new_entry->wired_count = 0;
 			if (new_entry->eflags & MAP_ENTRY_VN_WRITECNT) {
-				object = new_entry->object.vm_object;
-				KASSERT(((struct vnode *)object->handle)->
-				    v_writecount > 0,
-				    ("vmspace_fork: v_writecount"));
-				KASSERT(object->un_pager.vnp.writemappings > 0,
-				    ("vmspace_fork: vnp.writecount"));
 				vnode_pager_update_writecount(object,
 				    new_entry->start, new_entry->end);
 			}



More information about the Midnightbsd-cvs mailing list