Skip to content

Commit

Permalink
Dump the spill blkptr earlier to avoid segfaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
dweeezil committed Sep 18, 2014
1 parent 277a0f7 commit 6efc9d3
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1877,19 +1877,17 @@ dump_object(objset_t *os, uint64_t object, int verbosity, int *print_header)
"SPILL_BLKPTR" : "");
(void) printf("\tdnode maxblkid: %llu\n",
(longlong_t)dn->dn_phys->dn_maxblkid);

if (verbosity >= 6 && (dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR)) {
char blkbuf[BP_SPRINTF_LEN];
snprintf_blkptr_compact(blkbuf, sizeof (blkbuf), &dn->dn_phys->dn_spill);
(void) printf("\n\tSpill blkptr:\n\t\t%s\n", blkbuf);
}
object_viewer[ZDB_OT_TYPE(doi.doi_bonus_type)](os, object,
bonus, bsize);
object_viewer[ZDB_OT_TYPE(doi.doi_type)](os, object, NULL, 0);
*print_header = 1;
}

if (verbosity >= 6 && (dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR)) {
char blkbuf[BP_SPRINTF_LEN];
snprintf_blkptr_compact(blkbuf, sizeof (blkbuf), &dn->dn_phys->dn_spill);
(void) printf("\n\tSpill blkptr:\n\t\t%s\n", blkbuf);
}

if (verbosity >= 5)
dump_indirect(dn);

Expand Down

0 comments on commit 6efc9d3

Please sign in to comment.