From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 16 06:17:15 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E3410EA4; Tue, 16 Apr 2013 06:17:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D5F5EEBE; Tue, 16 Apr 2013 06:17:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3G6HFLo027129; Tue, 16 Apr 2013 06:17:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3G6HFZY027128; Tue, 16 Apr 2013 06:17:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304160617.r3G6HFZY027128@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 16 Apr 2013 06:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249531 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 06:17:16 -0000 Author: kib Date: Tue Apr 16 06:17:15 2013 New Revision: 249531 URL: http://svnweb.freebsd.org/changeset/base/249531 Log: MFC r249303: Fix the assertions for the state of the object under the map entry with the MAP_ENTRY_VN_WRITECNT flag. Modified: stable/9/sys/vm/vm_map.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Tue Apr 16 05:57:16 2013 (r249530) +++ stable/9/sys/vm/vm_map.c Tue Apr 16 06:17:15 2013 (r249531) @@ -3160,6 +3160,22 @@ vmspace_fork(struct vmspace *vm1, vm_oof 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); /* @@ -3171,12 +3187,6 @@ vmspace_fork(struct vmspace *vm1, vm_oof 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); }