From b4cd4fe1aa8c43a779a3bc2132f3772565dc4d07 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 21 Dec 2022 09:17:00 -0800 Subject: [PATCH] Revert "zdb: zdb_ddt_leak_init() reads uninitialized memory..." This reverts commit d30db519af44b905fc52b8c8ba34f6378aa03470. With this change applied zloop.sh fails reliably with the following ASSERT. zio_wait(zio_claim(NULL, zcb->zcb_spa, refcnt ? 0 : spa_min_claim_txg( zcb->zcb_spa), bp, NULL, NULL, ZIO_FLAG_CANFAIL)) == 0 (0x2 == 0x0) ASSERT at cmd/zdb/zdb.c:5452:zdb_count_block() Reviewed-by: George Melikov Reviewed-by: Richard Yao Signed-off-by: Brian Behlendorf Closes #14306 --- cmd/zdb/zdb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index a3131ab041..b04b220c76 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -5779,10 +5779,9 @@ zdb_ddt_leak_init(spa_t *spa, zdb_cb_t *zcb) ASSERT(ddt_phys_total_refcnt(&dde) > 1); - if (ddp->ddp_phys_birth == 0) - continue; - for (p = 0; p < DDT_PHYS_TYPES; p++, ddp++) { + if (ddp->ddp_phys_birth == 0) + continue; ddt_bp_create(ddb.ddb_checksum, &dde.dde_key, ddp, &blk); if (p == DDT_PHYS_DITTO) {