Skip to content

Commit 2e8efe1

Browse files
grwilsonbehlendorf
authored andcommitted
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 <pcd@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Andriy Gapon <avg@FreeBSD.org> Reviewed by: Fabian Keil <fk@fabiankeil.de> Approved by: Gordon Ross <gordon.ross@nexenta.com> References: https://www.illumos.org/issues/6292 illumos/illumos-gate@a443cc8 Ported-by: kernelOfTruth kerneloftruth@gmail.com Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
1 parent 5511754 commit 2e8efe1

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

module/zfs/dsl_scan.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,11 +1470,24 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx)
14701470
dsl_scan_setup_sync(&func, tx);
14711471
}
14721472

1473+
/*
1474+
* Only process scans in sync pass 1.
1475+
*/
1476+
if (spa_sync_pass(dp->dp_spa) > 1)
1477+
return;
1478+
1479+
/*
1480+
* If the spa is shutting down, then stop scanning. This will
1481+
* ensure that the scan does not dirty any new data during the
1482+
* shutdown phase.
1483+
*/
1484+
if (spa_shutting_down(spa))
1485+
return;
1486+
14731487
/*
14741488
* If the scan is inactive due to a stalled async destroy, try again.
14751489
*/
1476-
if ((!scn->scn_async_stalled && !dsl_scan_active(scn)) ||
1477-
spa_sync_pass(dp->dp_spa) > 1)
1490+
if (!scn->scn_async_stalled && !dsl_scan_active(scn))
14781491
return;
14791492

14801493
scn->scn_visited_this_txg = 0;

0 commit comments

Comments
 (0)