From 6694ca5539c9b1d274db68d775963352e73b267c Mon Sep 17 00:00:00 2001 From: Finix1979 Date: Wed, 5 Oct 2022 01:55:35 +0800 Subject: [PATCH] Avoid unnecessary metaslab_check_free calling The metaslab_check_free() function only needs to be called in the GANG|DEDUP|etc case because zio_free_sync() will internally call metaslab_check_free(). Reviewed-by: Brian Behlendorf Reviewed-by: Richard Yao Signed-off-by: Finix1979 Closes #13977 --- module/zfs/zio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/zio.c b/module/zfs/zio.c index c2e3c6169..dce94b7b2 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -1203,7 +1203,6 @@ zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp) */ if (BP_IS_EMBEDDED(bp)) return; - metaslab_check_free(spa, bp); /* * Frees that are for the currently-syncing txg, are not going to be @@ -1220,6 +1219,7 @@ zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp) txg != spa->spa_syncing_txg || (spa_sync_pass(spa) >= zfs_sync_pass_deferred_free && !spa_feature_is_active(spa, SPA_FEATURE_LOG_SPACEMAP))) { + metaslab_check_free(spa, bp); bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); } else { VERIFY3P(zio_free_sync(NULL, spa, txg, bp, 0), ==, NULL);