Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Sep 2019 08:47:29 +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-12@freebsd.org
Subject:   svn commit: r351806 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201909040847.x848lTNU035899@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Wed Sep  4 08:47:29 2019
New Revision: 351806
URL: https://svnweb.freebsd.org/changeset/base/351806

Log:
  MFC r351168: zfs_vget: fix vnode reference count leak in error path

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==============================================================================
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Wed Sep  4 08:44:44 2019	(r351805)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Wed Sep  4 08:47:29 2019	(r351806)
@@ -2317,8 +2317,11 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int flags, vnode_t **
 	if (err == 0)
 		*vpp = ZTOV(zp);
 	ZFS_EXIT(zfsvfs);
-	if (err == 0)
+	if (err == 0) {
 		err = vn_lock(*vpp, flags);
+		if (err != 0)
+			vrele(*vpp);
+	}
 	if (err != 0)
 		*vpp = NULL;
 	return (err);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909040847.x848lTNU035899>