From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 18:53:33 2008 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 C80E91065687; Tue, 4 Nov 2008 18:53:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B647E8FC2F; Tue, 4 Nov 2008 18:53:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4IrXmB004782; Tue, 4 Nov 2008 18:53:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4IrXIV004781; Tue, 4 Nov 2008 18:53:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200811041853.mA4IrXIV004781@svn.freebsd.org> From: John Baldwin Date: Tue, 4 Nov 2008 18:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184649 - head/sys/compat/linprocfs 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: Tue, 04 Nov 2008 18:53:33 -0000 Author: jhb Date: Tue Nov 4 18:53:33 2008 New Revision: 184649 URL: http://svn.freebsd.org/changeset/base/184649 Log: Don't leak a reference on the /compat/linux vnode everytime the linprocfs 'mtab' file is read. MFC after: 1 month Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Tue Nov 4 18:38:48 2008 (r184648) +++ head/sys/compat/linprocfs/linprocfs.c Tue Nov 4 18:53:33 2008 (r184649) @@ -318,11 +318,13 @@ linprocfs_domtab(PFS_FILL_ARGS) NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, linux_emul_path, td); flep = NULL; error = namei(&nd); - VFS_UNLOCK_GIANT(NDHASGIANT(&nd)); - if (error != 0 || vn_fullpath(td, nd.ni_vp, &dlep, &flep) != 0) - lep = linux_emul_path; - else - lep = dlep; + lep = linux_emul_path; + if (error == 0) { + if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) != 0) + lep = dlep; + vrele(nd.ni_vp); + VFS_UNLOCK_GIANT(NDHASGIANT(&nd)); + } lep_len = strlen(lep); mtx_lock(&mountlist_mtx);