Skip to content

Commit

Permalink
maybe I can't reorder it that much
Browse files Browse the repository at this point in the history
  • Loading branch information
snajpa committed Feb 18, 2024
1 parent 8299846 commit 26818ad
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions module/zfs/dsl_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 26818ad

Please sign in to comment.