aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zdb
diff options
context:
space:
mode:
authorGeorge Amanakis <[email protected]>2023-02-03 00:17:37 +0100
committerGitHub <[email protected]>2023-02-02 15:17:37 -0800
commitac2038a19c3b7e9ba913a850e05ba773725bd25d (patch)
treee03fea9d37b65056b2960999de72020a22f4f701 /cmd/zdb
parent326f1e3d88dab158b8aad8c49b96fa292b5912e5 (diff)
Teach zdb about DMU_OT_ERROR_LOG objects
With the persistent error log feature we need to account for spa_errlog_{scrub, last} containing mappings to other error log objects, which need to be marked as in-use as well. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes #14442 Closes #14434
Diffstat (limited to 'cmd/zdb')
-rw-r--r--cmd/zdb/zdb.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index b04b220c7..d6e3c5806 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -7509,6 +7509,19 @@ mos_leak_log_spacemaps(spa_t *spa)
mos_obj_refd(sls->sls_sm_obj);
}
+static void
+errorlog_count_refd(objset_t *mos, uint64_t errlog)
+{
+ zap_cursor_t zc;
+ zap_attribute_t za;
+ for (zap_cursor_init(&zc, mos, errlog);
+ zap_cursor_retrieve(&zc, &za) == 0;
+ zap_cursor_advance(&zc)) {
+ mos_obj_refd(za.za_first_integer);
+ }
+ zap_cursor_fini(&zc);
+}
+
static int
dump_mos_leaks(spa_t *spa)
{
@@ -7529,6 +7542,12 @@ dump_mos_leaks(spa_t *spa)
mos_obj_refd(spa->spa_history);
mos_obj_refd(spa->spa_errlog_last);
mos_obj_refd(spa->spa_errlog_scrub);
+
+ if (!spa_feature_is_enabled(spa, SPA_FEATURE_HEAD_ERRLOG)) {
+ errorlog_count_refd(mos, spa->spa_errlog_last);
+ errorlog_count_refd(mos, spa->spa_errlog_scrub);
+ }
+
mos_obj_refd(spa->spa_all_vdev_zaps);
mos_obj_refd(spa->spa_dsl_pool->dp_bptree_obj);
mos_obj_refd(spa->spa_dsl_pool->dp_tmp_userrefs_obj);