Date: Wed, 13 Jul 2016 10:10:21 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r302747 - in stable/9/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/common/fs/zfs Message-ID: <201607131010.u6DAALuW004391@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Wed Jul 13 10:10:21 2016 New Revision: 302747 URL: https://svnweb.freebsd.org/changeset/base/302747 Log: MFC r299940: fix a vnode reference leak caused by illumos compat traverse() Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Wed Jul 13 10:10:05 2016 (r302746) +++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Wed Jul 13 10:10:21 2016 (r302747) @@ -89,6 +89,7 @@ traverse(vnode_t **cvpp, int lktype) if (vfsp == NULL) break; error = vfs_busy(vfsp, 0); + /* * tvp is NULL for *cvpp vnode, which we can't unlock. */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Jul 13 10:10:05 2016 (r302746) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Jul 13 10:10:21 2016 (r302747) @@ -1004,7 +1004,6 @@ zfsctl_snapdir_lookup(ap) VN_HOLD(*vpp); err = traverse(vpp, LK_EXCLUSIVE | LK_RETRY); if (err != 0) { - VN_RELE(*vpp); *vpp = NULL; } else if (*vpp == sep->se_root) { /* @@ -1587,16 +1586,15 @@ zfsctl_lookup_objset(vfs_t *vfsp, uint64 */ error = traverse(&vp, LK_SHARED | LK_RETRY); if (error == 0) { - if (vp == sep->se_root) + if (vp == sep->se_root) { + VN_RELE(vp); /* release covered vp */ error = SET_ERROR(EINVAL); - else + } else { *zfsvfsp = VTOZ(vp)->z_zfsvfs; + VN_URELE(vp); /* put snapshot's root vp */ + } } mutex_exit(&sdp->sd_lock); - if (error == 0) - VN_URELE(vp); - else - VN_RELE(vp); } else { error = SET_ERROR(EINVAL); mutex_exit(&sdp->sd_lock);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607131010.u6DAALuW004391>