From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 10:51:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA565106566C; Sun, 7 Feb 2010 10:51:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 938828FC1B; Sun, 7 Feb 2010 10:51:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17ApHcX098147; Sun, 7 Feb 2010 10:51:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17ApHJK098144; Sun, 7 Feb 2010 10:51:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002071051.o17ApHJK098144@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 7 Feb 2010 10:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203607 - stable/8/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 10:51:17 -0000 Author: kib Date: Sun Feb 7 10:51:17 2010 New Revision: 203607 URL: http://svn.freebsd.org/changeset/base/203607 Log: MFC r202529: vunref() the vnode in vm object deallocation code for OBJT_VNODE appropriate number of times to prevent possible vnode reference leak. Modified: stable/8/sys/vm/vm_pageout.c stable/8/sys/vm/vnode_pager.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/vm/vm_pageout.c ============================================================================== --- stable/8/sys/vm/vm_pageout.c Sun Feb 7 10:44:44 2010 (r203606) +++ stable/8/sys/vm/vm_pageout.c Sun Feb 7 10:51:17 2010 (r203607) @@ -951,6 +951,8 @@ rescan0: vnodes_skipped++; goto unlock_and_continue; } + KASSERT(mp != NULL, + ("vp %p with NULL v_mount", vp)); vm_page_unlock_queues(); vm_object_reference_locked(object); VM_OBJECT_UNLOCK(object); Modified: stable/8/sys/vm/vnode_pager.c ============================================================================== --- stable/8/sys/vm/vnode_pager.c Sun Feb 7 10:44:44 2010 (r203606) +++ stable/8/sys/vm/vnode_pager.c Sun Feb 7 10:51:17 2010 (r203607) @@ -250,13 +250,16 @@ static void vnode_pager_dealloc(object) vm_object_t object; { - struct vnode *vp = object->handle; + struct vnode *vp; + int refs; + vp = object->handle; if (vp == NULL) panic("vnode_pager_dealloc: pager already dealloced"); VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); vm_object_pip_wait(object, "vnpdea"); + refs = object->ref_count; object->handle = NULL; object->type = OBJT_DEAD; @@ -267,6 +270,8 @@ vnode_pager_dealloc(object) ASSERT_VOP_ELOCKED(vp, "vnode_pager_dealloc"); vp->v_object = NULL; vp->v_vflag &= ~VV_TEXT; + while (refs-- > 0) + vunref(vp); } static boolean_t