Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jul 2014 10:25:42 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269053 - head/sys/vm
Message-ID:  <201407241025.s6OAPgYq053074@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Jul 24 10:25:42 2014
New Revision: 269053
URL: http://svnweb.freebsd.org/changeset/base/269053

Log:
  Correct assertion.  The shadowing object cannot be tmpfs vm object,
  and tmpfs object cannot shadow.  In other words, tmpfs vm object is
  always at the bottom of the shadow chain.
  
  Reported and tested by:	bdrewery
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/vm/vm_object.c

Modified: head/sys/vm/vm_object.c
==============================================================================
--- head/sys/vm/vm_object.c	Thu Jul 24 10:14:51 2014	(r269052)
+++ head/sys/vm/vm_object.c	Thu Jul 24 10:25:42 2014	(r269053)
@@ -559,8 +559,6 @@ vm_object_deallocate(vm_object_t object)
 			    (object->handle == NULL) &&
 			    (object->type == OBJT_DEFAULT ||
 			     object->type == OBJT_SWAP)) {
-				KASSERT((object->flags & OBJ_TMPFS_NODE) == 0,
-				    ("shadowed tmpfs v_object %p", object));
 				vm_object_t robject;
 
 				robject = LIST_FIRST(&object->shadow_head);
@@ -568,6 +566,8 @@ vm_object_deallocate(vm_object_t object)
 				    ("vm_object_deallocate: ref_count: %d, shadow_count: %d",
 					 object->ref_count,
 					 object->shadow_count));
+				KASSERT((robject->flags & OBJ_TMPFS_NODE) == 0,
+				    ("shadowed tmpfs v_object %p", object));
 				if (!VM_OBJECT_TRYWLOCK(robject)) {
 					/*
 					 * Avoid a potential deadlock.
@@ -637,6 +637,8 @@ retry:
 doterm:
 		temp = object->backing_object;
 		if (temp != NULL) {
+			KASSERT((object->flags & OBJ_TMPFS_NODE) == 0,
+			    ("shadowed tmpfs v_object 2 %p", object));
 			VM_OBJECT_WLOCK(temp);
 			LIST_REMOVE(object, shadow_list);
 			temp->shadow_count--;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407241025.s6OAPgYq053074>