From 26818ada364dc78d150127be6f42464cb0aa0122 Mon Sep 17 00:00:00 2001 From: Pavel Snajdr Date: Sun, 4 Feb 2024 17:14:39 +0100 Subject: [PATCH] maybe I can't reorder it that much --- module/zfs/dsl_scan.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index 80e5d8b628..ea570da369 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -4276,20 +4276,6 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx) if (spa_sync_pass(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)) - return; - /* * issued/to_issue as presented to the user * in print_scan_scrub_resilver_status() issued/total_i @@ -4320,6 +4306,20 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx) dsl_scan_setup_sync(&func, tx); } + /* + * 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)) + return; + /* reset scan statistics */ scn->scn_visited_this_txg = 0; scn->scn_dedup_frees_this_txg = 0;