diff options
author | smh <smh@FreeBSD.org> | 2014-10-16 08:33:11 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2014-10-16 08:33:11 +0000 |
commit | d66b9a99493aa3262767cbaafd361673d11e0481 (patch) | |
tree | 88cb6de69f685aad02a045f8e55a4348d70742ac | |
parent | d37b3c75ad839922549856f5a93907da193adb0f (diff) | |
download | FreeBSD-src-d66b9a99493aa3262767cbaafd361673d11e0481.zip FreeBSD-src-d66b9a99493aa3262767cbaafd361673d11e0481.tar.gz |
MFC r273158:
Prevent ZFS leaking pool free space
Early MFC approved by re@
Approved by: re@ (glebius)
Sponsored by: Multiplay
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c index e75b1a5..7c93a0fe 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c @@ -1476,13 +1476,6 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx) "traverse_dataset_destroyed()", err); } - /* - * If we didn't make progress, mark the async destroy as - * stalled, so that we will not initiate a spa_sync() on - * its behalf. - */ - scn->scn_async_stalled = (scn->scn_visited_this_txg == 0); - if (bptree_is_empty(dp->dp_meta_objset, dp->dp_bptree_obj)) { /* finished; deactivate async destroy feature */ spa_feature_decr(spa, SPA_FEATURE_ASYNC_DESTROY, tx); @@ -1495,6 +1488,14 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx) dp->dp_bptree_obj, tx)); dp->dp_bptree_obj = 0; scn->scn_async_destroying = B_FALSE; + } else { + /* + * If we didn't make progress, mark the async destroy as + * stalled, so that we will not initiate a spa_sync() on + * its behalf. + */ + scn->scn_async_stalled = + (scn->scn_visited_this_txg == 0); } } if (scn->scn_visited_this_txg) { |