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 authored and Tim Chase committed Nov 3, 2014
1 parent b97e7f1 commit d31c1b8
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 d31c1b8

Please sign in to comment.