From owner-svn-src-stable-9@FreeBSD.ORG Tue Jan 10 13:41:15 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5883F106566C; Tue, 10 Jan 2012 13:41:15 +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 2C1A38FC16; Tue, 10 Jan 2012 13:41:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0ADfFPX012749; Tue, 10 Jan 2012 13:41:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ADfEf7012745; Tue, 10 Jan 2012 13:41:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201101341.q0ADfEf7012745@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 10 Jan 2012 13:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229932 - stable/9/sys/fs/nullfs X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 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, 10 Jan 2012 13:41:15 -0000 Author: kib Date: Tue Jan 10 13:41:14 2012 New Revision: 229932 URL: http://svn.freebsd.org/changeset/base/229932 Log: MFC r229431: Do the vput() for the lowervp in the null_nodeget() for error case too. Several callers of null_nodeget() did the cleanup itself, but several missed it, most prominent being null_bypass(). Remove the cleanup from the callers, now null_nodeget() handles lowervp free itself. Modified: stable/9/sys/fs/nullfs/null_subr.c stable/9/sys/fs/nullfs/null_vfsops.c stable/9/sys/fs/nullfs/null_vnops.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/fs/nullfs/null_subr.c ============================================================================== --- stable/9/sys/fs/nullfs/null_subr.c Tue Jan 10 13:34:39 2012 (r229931) +++ stable/9/sys/fs/nullfs/null_subr.c Tue Jan 10 13:41:14 2012 (r229932) @@ -171,6 +171,8 @@ null_hashins(mp, xp) static void null_insmntque_dtr(struct vnode *vp, void *xp) { + + vput(((struct null_node *)xp)->null_lowervp); vp->v_data = NULL; vp->v_vnlock = &vp->v_lock; free(xp, M_NULLFSNODE); @@ -226,6 +228,7 @@ null_nodeget(mp, lowervp, vpp) error = getnewvnode("null", mp, &null_vnodeops, &vp); if (error) { + vput(lowervp); free(xp, M_NULLFSNODE); return (error); } Modified: stable/9/sys/fs/nullfs/null_vfsops.c ============================================================================== --- stable/9/sys/fs/nullfs/null_vfsops.c Tue Jan 10 13:34:39 2012 (r229931) +++ stable/9/sys/fs/nullfs/null_vfsops.c Tue Jan 10 13:41:14 2012 (r229932) @@ -157,8 +157,7 @@ nullfs_mount(struct mount *mp) * Make sure the node alias worked */ if (error) { - vrele(lowerrootvp); - free(xmp, M_NULLFSMNT); /* XXX */ + free(xmp, M_NULLFSMNT); return (error); } Modified: stable/9/sys/fs/nullfs/null_vnops.c ============================================================================== --- stable/9/sys/fs/nullfs/null_vnops.c Tue Jan 10 13:34:39 2012 (r229931) +++ stable/9/sys/fs/nullfs/null_vnops.c Tue Jan 10 13:41:14 2012 (r229932) @@ -365,9 +365,7 @@ null_lookup(struct vop_lookup_args *ap) vrele(lvp); } else { error = null_nodeget(dvp->v_mount, lvp, &vp); - if (error) - vput(lvp); - else + if (error == 0) *ap->a_vpp = vp; } } @@ -809,9 +807,7 @@ null_vptocnp(struct vop_vptocnp_args *ap NULLVPTOLOWERVP(*dvp); #endif VOP_UNLOCK(*dvp, 0); /* keep reference on *dvp */ - } else - vput(ldvp); - + } vn_lock(vp, locked | LK_RETRY); return (error); }