Skip to content

Commit a0c9a17

Browse files
jjelinekbehlendorf
authored andcommitted
Illumos 4901 - zfs filesystem/snapshot limit leaks
4901 zfs filesystem/snapshot limit leaks Reviewed by: Matthew Ahrens <mahrens@delphix.com> Approved by: Dan McDonald <danmcd@omniti.com> References: https://www.illumos.org/issues/4901 illumos/illumos-gate@adf3407 Ported by: Brian Behlendorf <behlendorf1@llnl.gov>
1 parent 8301731 commit a0c9a17

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

module/zfs/dsl_dir.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ dsl_dir_init_fs_ss_count(dsl_dir_t *dd, dmu_tx_t *tx)
512512
zap_attribute_t *za;
513513
dsl_dataset_t *ds;
514514

515-
ASSERT(spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT));
515+
ASSERT(spa_feature_is_active(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT));
516516
ASSERT(dsl_pool_config_held(dp));
517517
ASSERT(dmu_tx_is_syncing(tx));
518518

@@ -1751,7 +1751,7 @@ dsl_dir_rename_check(void *arg, dmu_tx_t *tx)
17511751
}
17521752

17531753
if (dmu_tx_is_syncing(tx)) {
1754-
if (spa_feature_is_enabled(dp->dp_spa,
1754+
if (spa_feature_is_active(dp->dp_spa,
17551755
SPA_FEATURE_FS_SS_LIMIT)) {
17561756
/*
17571757
* Although this is the check function and we don't
@@ -1780,8 +1780,11 @@ dsl_dir_rename_check(void *arg, dmu_tx_t *tx)
17801780
err = zap_lookup(os, dd->dd_object,
17811781
DD_FIELD_FILESYSTEM_COUNT, sizeof (fs_cnt), 1,
17821782
&fs_cnt);
1783-
if (err != ENOENT && err != 0)
1783+
if (err != ENOENT && err != 0) {
1784+
dsl_dir_rele(newparent, FTAG);
1785+
dsl_dir_rele(dd, FTAG);
17841786
return (err);
1787+
}
17851788

17861789
/*
17871790
* have to add 1 for the filesystem itself that we're
@@ -1792,8 +1795,11 @@ dsl_dir_rename_check(void *arg, dmu_tx_t *tx)
17921795
err = zap_lookup(os, dd->dd_object,
17931796
DD_FIELD_SNAPSHOT_COUNT, sizeof (ss_cnt), 1,
17941797
&ss_cnt);
1795-
if (err != ENOENT && err != 0)
1798+
if (err != ENOENT && err != 0) {
1799+
dsl_dir_rele(newparent, FTAG);
1800+
dsl_dir_rele(dd, FTAG);
17961801
return (err);
1802+
}
17971803
}
17981804

17991805
/* no rename into our descendant */
@@ -1844,7 +1850,7 @@ dsl_dir_rename_sync(void *arg, dmu_tx_t *tx)
18441850
* We already made sure the dd counts were initialized in the
18451851
* check function.
18461852
*/
1847-
if (spa_feature_is_enabled(dp->dp_spa,
1853+
if (spa_feature_is_active(dp->dp_spa,
18481854
SPA_FEATURE_FS_SS_LIMIT)) {
18491855
VERIFY0(zap_lookup(os, dd->dd_object,
18501856
DD_FIELD_FILESYSTEM_COUNT, sizeof (fs_cnt), 1,

0 commit comments

Comments
 (0)