From 6e82fa2a0d9eae73d681672bedfabc9d945de9aa Mon Sep 17 00:00:00 2001 From: Pavel Snajdr Date: Sun, 28 Jan 2024 22:48:58 +0100 Subject: [PATCH] always make sure the feature is active as I can't reproduce the zfeature.c assert I'm going to take a blind guess and see if this is what is making it unhappy Signed-off-by: Pavel Snajdr --- module/zfs/dsl_scan.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index 1a4c91ce4380..0cd03499636c 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -4266,6 +4266,10 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx) uint64_t to_issue, issued; int restart_early; + if (spa->spa_resilver_deferred && + !spa_feature_is_active(dp->dp_spa, SPA_FEATURE_RESILVER_DEFER)) + spa_feature_incr(spa, SPA_FEATURE_RESILVER_DEFER, tx); + /* * Only process scans in sync pass 1. */ @@ -4297,10 +4301,6 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx) zfs_resilver_disable_defer || (issued < (to_issue * zfs_resilver_defer_percent / 100))); - if (spa->spa_resilver_deferred && - !spa_feature_is_active(dp->dp_spa, SPA_FEATURE_RESILVER_DEFER)) - spa_feature_incr(spa, SPA_FEATURE_RESILVER_DEFER, tx); - /* * Check for scn_restart_txg before checking spa_load_state, so * that we can restart an old-style scan while the pool is being