Defer resilver only when progress is above a threshold v2

Fix the restart_early condition to avoid restart loop on pool export.
This commit is contained in:
Pavel Snajdr 2024-01-24 21:16:44 +01:00
parent f8b3efbf30
commit 8100df022b
1 changed files with 2 additions and 1 deletions

View File

@ -4284,7 +4284,8 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx)
/*
* Make sure we're not in a restart loop and check the threshold
*/
restart_early = spa->spa_resilver_deferred &&
restart_early = (spa_sync_pass(spa) == 1) &&
spa->spa_resilver_deferred &&
!dsl_scan_restarting(scn, tx) &&
(issued < (to_issue * zfs_resilver_defer_percent / 100));