mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-14 04:00:31 +03:00
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 https://github.com/illumos/illumos-gate/commit/adf3407 Ported by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
parent
83017311e4
commit
a0c9a17aef
@ -512,7 +512,7 @@ dsl_dir_init_fs_ss_count(dsl_dir_t *dd, dmu_tx_t *tx)
|
|||||||
zap_attribute_t *za;
|
zap_attribute_t *za;
|
||||||
dsl_dataset_t *ds;
|
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(dsl_pool_config_held(dp));
|
||||||
ASSERT(dmu_tx_is_syncing(tx));
|
ASSERT(dmu_tx_is_syncing(tx));
|
||||||
|
|
||||||
@ -1751,7 +1751,7 @@ dsl_dir_rename_check(void *arg, dmu_tx_t *tx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dmu_tx_is_syncing(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)) {
|
SPA_FEATURE_FS_SS_LIMIT)) {
|
||||||
/*
|
/*
|
||||||
* Although this is the check function and we don't
|
* Although this is the check function and we don't
|
||||||
@ -1780,8 +1780,11 @@ dsl_dir_rename_check(void *arg, dmu_tx_t *tx)
|
|||||||
err = zap_lookup(os, dd->dd_object,
|
err = zap_lookup(os, dd->dd_object,
|
||||||
DD_FIELD_FILESYSTEM_COUNT, sizeof (fs_cnt), 1,
|
DD_FIELD_FILESYSTEM_COUNT, sizeof (fs_cnt), 1,
|
||||||
&fs_cnt);
|
&fs_cnt);
|
||||||
if (err != ENOENT && err != 0)
|
if (err != ENOENT && err != 0) {
|
||||||
|
dsl_dir_rele(newparent, FTAG);
|
||||||
|
dsl_dir_rele(dd, FTAG);
|
||||||
return (err);
|
return (err);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* have to add 1 for the filesystem itself that we're
|
* have to add 1 for the filesystem itself that we're
|
||||||
@ -1792,9 +1795,12 @@ dsl_dir_rename_check(void *arg, dmu_tx_t *tx)
|
|||||||
err = zap_lookup(os, dd->dd_object,
|
err = zap_lookup(os, dd->dd_object,
|
||||||
DD_FIELD_SNAPSHOT_COUNT, sizeof (ss_cnt), 1,
|
DD_FIELD_SNAPSHOT_COUNT, sizeof (ss_cnt), 1,
|
||||||
&ss_cnt);
|
&ss_cnt);
|
||||||
if (err != ENOENT && err != 0)
|
if (err != ENOENT && err != 0) {
|
||||||
|
dsl_dir_rele(newparent, FTAG);
|
||||||
|
dsl_dir_rele(dd, FTAG);
|
||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* no rename into our descendant */
|
/* no rename into our descendant */
|
||||||
if (closest_common_ancestor(dd, newparent) == dd) {
|
if (closest_common_ancestor(dd, newparent) == dd) {
|
||||||
@ -1844,7 +1850,7 @@ dsl_dir_rename_sync(void *arg, dmu_tx_t *tx)
|
|||||||
* We already made sure the dd counts were initialized in the
|
* We already made sure the dd counts were initialized in the
|
||||||
* check function.
|
* check function.
|
||||||
*/
|
*/
|
||||||
if (spa_feature_is_enabled(dp->dp_spa,
|
if (spa_feature_is_active(dp->dp_spa,
|
||||||
SPA_FEATURE_FS_SS_LIMIT)) {
|
SPA_FEATURE_FS_SS_LIMIT)) {
|
||||||
VERIFY0(zap_lookup(os, dd->dd_object,
|
VERIFY0(zap_lookup(os, dd->dd_object,
|
||||||
DD_FIELD_FILESYSTEM_COUNT, sizeof (fs_cnt), 1,
|
DD_FIELD_FILESYSTEM_COUNT, sizeof (fs_cnt), 1,
|
||||||
|
Loading…
Reference in New Issue
Block a user