diff options
author | George Wilson <[email protected]> | 2015-11-04 21:12:40 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-01-12 09:10:52 -0800 |
commit | 2e8efe1befcbfb7bd832bf9717a2db95a420ba1c (patch) | |
tree | 39eb437b5c6207837475b000ab0d144fda1df9e7 | |
parent | 5511754b4fa6b105941ec4e19a3b1c2b34bb7452 (diff) |
Illumos 6292 - exporting a pool while an async destroy
6292 exporting a pool while an async destroy is running can leave
entries in the deferred tree
Reviewed by: Paul Dagnelie <[email protected]>
Reviewed by: Matthew Ahrens <[email protected]>
Reviewed by: Andriy Gapon <[email protected]>
Reviewed by: Fabian Keil <[email protected]>
Approved by: Gordon Ross <[email protected]>
References:
https://www.illumos.org/issues/6292
https://github.com/illumos/illumos-gate/commit/a443cc8
Ported-by: kernelOfTruth [email protected]
Signed-off-by: Brian Behlendorf <[email protected]>
-rw-r--r-- | module/zfs/dsl_scan.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index 295b8df8b..477da2a5f 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -1471,10 +1471,23 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx) } /* + * Only process scans in sync pass 1. + */ + if (spa_sync_pass(dp->dp_spa) > 1) + return; + + /* + * If the spa is shutting down, then stop scanning. This will + * ensure that the scan does not dirty any new data during the + * shutdown phase. + */ + if (spa_shutting_down(spa)) + return; + + /* * If the scan is inactive due to a stalled async destroy, try again. */ - if ((!scn->scn_async_stalled && !dsl_scan_active(scn)) || - spa_sync_pass(dp->dp_spa) > 1) + if (!scn->scn_async_stalled && !dsl_scan_active(scn)) return; scn->scn_visited_this_txg = 0; |