svn commit: r250263 - stable/9/sys/vm

Konstantin Belousov kib at FreeBSD.org
Sun May 5 06:32:14 UTC 2013


Author: kib
Date: Sun May  5 06:32:13 2013
New Revision: 250263
URL: http://svnweb.freebsd.org/changeset/base/250263

Log:
  MFC r250028:
  Assert that the object type for the vnode' non-NULL v_object, passed
  to vnode_pager_setsize(), is either OBJT_VNODE, or, if vnode was
  already reclaimed, OBJT_DEAD.
  
  More, if the object is terminated, do not perform the resizing operation.

Modified:
  stable/9/sys/vm/vnode_pager.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/vm/vnode_pager.c
==============================================================================
--- stable/9/sys/vm/vnode_pager.c	Sun May  5 06:25:28 2013	(r250262)
+++ stable/9/sys/vm/vnode_pager.c	Sun May  5 06:32:13 2013	(r250263)
@@ -380,6 +380,12 @@ vnode_pager_setsize(vp, nsize)
 		return;
 /* 	ASSERT_VOP_ELOCKED(vp, "vnode_pager_setsize and not locked vnode"); */
 	VM_OBJECT_LOCK(object);
+	if (object->type == OBJT_DEAD) {
+		VM_OBJECT_UNLOCK(object);
+		return;
+	}
+	KASSERT(object->type == OBJT_VNODE,
+	    ("not vnode-backed object %p", object));
 	if (nsize == object->un_pager.vnp.vnp_size) {
 		/*
 		 * Hasn't changed size


More information about the svn-src-stable-9 mailing list