Skip to content

Commit

Permalink
Fix erroneous zstreamdump warning
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Amanakis <gamanakis@gmail.com>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes openzfs#13154
  • Loading branch information
pcd1193182 authored and andrewc12 committed Sep 23, 2022
1 parent 41d3ca6 commit 28f78e1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/zstream/zstream_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ zstream_do_dump(int argc, char *argv[])

fletcher_4_init();
while (read_hdr(drr, &zc)) {
uint64_t featureflags = 0;

/*
* If this is the first DMU record being processed, check for
Expand Down Expand Up @@ -362,6 +363,9 @@ zstream_do_dump(int argc, char *argv[])
BSWAP_64(drrb->drr_fromguid);
}

featureflags =
DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo);

(void) printf("BEGIN record\n");
(void) printf("\thdrtype = %lld\n",
DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo));
Expand Down Expand Up @@ -461,7 +465,8 @@ zstream_do_dump(int argc, char *argv[])
BSWAP_64(drro->drr_maxblkid);
}

if (drro->drr_bonuslen > drro->drr_raw_bonuslen) {
if (featureflags & DMU_BACKUP_FEATURE_RAW &&
drro->drr_bonuslen > drro->drr_raw_bonuslen) {
(void) fprintf(stderr,
"Warning: Object %llu has bonuslen = "
"%u > raw_bonuslen = %u\n\n",
Expand Down

0 comments on commit 28f78e1

Please sign in to comment.