]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Revert "zdb: zdb_ddt_leak_init() reads uninitialized memory..."
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 21 Dec 2022 17:17:00 +0000 (09:17 -0800)
committerGitHub <noreply@github.com>
Wed, 21 Dec 2022 17:17:00 +0000 (09:17 -0800)
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 <mail@gmelikov.ru>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #14306

cmd/zdb/zdb.c

index a3131ab041a6579eade11296942a609e2afda015..b04b220c768ef7f524c68ee35ee3272d44afebb0 100644 (file)
@@ -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) {