svn commit: r267139 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Xin LI delphij at FreeBSD.org
Fri Jun 6 00:15:55 UTC 2014


Author: delphij
Date: Fri Jun  6 00:15:54 2014
New Revision: 267139
URL: http://svnweb.freebsd.org/changeset/base/267139

Log:
  MFC r266915: MFV 266913+266914:
  
  3897 zfs filesystem and snapshot limits (fix leak)
  4901 zfs filesystem/snapshot limit leaks
  
  Approved by:	re (gjb)

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

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c	Fri Jun  6 00:13:38 2014	(r267138)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c	Fri Jun  6 00:15:54 2014	(r267139)
@@ -489,7 +489,7 @@ dsl_dir_init_fs_ss_count(dsl_dir_t *dd, 
 	zap_attribute_t *za;
 	dsl_dataset_t *ds;
 
-	ASSERT(spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT));
+	ASSERT(spa_feature_is_active(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT));
 	ASSERT(dsl_pool_config_held(dp));
 	ASSERT(dmu_tx_is_syncing(tx));
 
@@ -549,6 +549,7 @@ dsl_dir_init_fs_ss_count(dsl_dir_t *dd, 
 		if (za->za_name[0] != '%')
 			my_ss_cnt++;
 	}
+	zap_cursor_fini(zc);
 
 	dsl_dataset_rele(ds, FTAG);
 
@@ -1717,7 +1718,7 @@ dsl_dir_rename_check(void *arg, dmu_tx_t
 	}
 
 	if (dmu_tx_is_syncing(tx)) {
-		if (spa_feature_is_enabled(dp->dp_spa,
+		if (spa_feature_is_active(dp->dp_spa,
 		    SPA_FEATURE_FS_SS_LIMIT)) {
 			/*
 			 * Although this is the check function and we don't
@@ -1745,8 +1746,11 @@ dsl_dir_rename_check(void *arg, dmu_tx_t
 			err = zap_lookup(os, dd->dd_object,
 			    DD_FIELD_FILESYSTEM_COUNT, sizeof (fs_cnt), 1,
 			    &fs_cnt);
-			if (err != ENOENT && err != 0)
+			if (err != ENOENT && err != 0) {
+				dsl_dir_rele(newparent, FTAG);
+				dsl_dir_rele(dd, FTAG);
 				return (err);
+			}
 
 			/*
 			 * have to add 1 for the filesystem itself that we're
@@ -1757,8 +1761,11 @@ dsl_dir_rename_check(void *arg, dmu_tx_t
 			err = zap_lookup(os, dd->dd_object,
 			    DD_FIELD_SNAPSHOT_COUNT, sizeof (ss_cnt), 1,
 			    &ss_cnt);
-			if (err != ENOENT && err != 0)
+			if (err != ENOENT && err != 0) {
+				dsl_dir_rele(newparent, FTAG);
+				dsl_dir_rele(dd, FTAG);
 				return (err);
+			}
 		}
 
 		/* no rename into our descendant */
@@ -1809,7 +1816,7 @@ dsl_dir_rename_sync(void *arg, dmu_tx_t 
 		 * We already made sure the dd counts were initialized in the
 		 * check function.
 		 */
-		if (spa_feature_is_enabled(dp->dp_spa,
+		if (spa_feature_is_active(dp->dp_spa,
 		    SPA_FEATURE_FS_SS_LIMIT)) {
 			VERIFY0(zap_lookup(os, dd->dd_object,
 			    DD_FIELD_FILESYSTEM_COUNT, sizeof (fs_cnt), 1,


More information about the svn-src-stable-9 mailing list