Skip to content

Commit

Permalink
4901 zfs filesystem/snapshot limit leaks
Browse files Browse the repository at this point in the history
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
  • Loading branch information
jjelinek authored and rmustacc committed May 30, 2014
1 parent 3fabe51 commit adf3407
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions usr/src/uts/common/fs/zfs/dsl_dir.c
Expand Up @@ -484,7 +484,7 @@ dsl_dir_init_fs_ss_count(dsl_dir_t *dd, dmu_tx_t *tx)
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));

Expand Down Expand Up @@ -1710,7 +1710,7 @@ dsl_dir_rename_check(void *arg, dmu_tx_t *tx)
}

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
Expand Down Expand Up @@ -1738,8 +1738,11 @@ dsl_dir_rename_check(void *arg, dmu_tx_t *tx)
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
Expand All @@ -1750,8 +1753,11 @@ dsl_dir_rename_check(void *arg, dmu_tx_t *tx)
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 */
Expand Down Expand Up @@ -1802,7 +1808,7 @@ dsl_dir_rename_sync(void *arg, dmu_tx_t *tx)
* 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,
Expand Down

0 comments on commit adf3407

Please sign in to comment.