Fix unreachable code in zstreamdump

82226e4f44 was intended to prevent a
warning from being printed in situations where it was inappropriate, but
accidentally disabled it entirely by setting featureflags in the wrong
case statement.

Coverity reported this as dead code.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13946
This commit is contained in:
Richard Yao 2022-09-29 13:16:37 -04:00 committed by GitHub
parent 4acc36ed7c
commit dee8934e8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -363,9 +363,6 @@ zstream_do_dump(int argc, char *argv[])
BSWAP_64(drrb->drr_fromguid); BSWAP_64(drrb->drr_fromguid);
} }
featureflags =
DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo);
(void) printf("BEGIN record\n"); (void) printf("BEGIN record\n");
(void) printf("\thdrtype = %lld\n", (void) printf("\thdrtype = %lld\n",
DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo)); DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo));
@ -465,6 +462,9 @@ zstream_do_dump(int argc, char *argv[])
BSWAP_64(drro->drr_maxblkid); BSWAP_64(drro->drr_maxblkid);
} }
featureflags =
DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo);
if (featureflags & DMU_BACKUP_FEATURE_RAW && if (featureflags & DMU_BACKUP_FEATURE_RAW &&
drro->drr_bonuslen > drro->drr_raw_bonuslen) { drro->drr_bonuslen > drro->drr_raw_bonuslen) {
(void) fprintf(stderr, (void) fprintf(stderr,