aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zstreamdump/zstreamdump.c
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2020-02-13 11:24:57 -0800
committerGitHub <[email protected]>2020-02-13 11:24:57 -0800
commitf49b7a0d8ec2579c1f06c8ea7581448927482fb2 (patch)
treec702ab6887f53da27c2f76f1a525ccad56f2e288 /cmd/zstreamdump/zstreamdump.c
parent2adc6b35aebc722d83329f0e340833263c6415aa (diff)
fix zstreamdump -C
zstreamdump -C always fails. It is not calculating the checksums, but it's still trying to verify that the (non-calculated) checksum matches the one stored in the send stream. This change makes zstreamdump -C not verify checksums. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #9983
Diffstat (limited to 'cmd/zstreamdump/zstreamdump.c')
-rw-r--r--cmd/zstreamdump/zstreamdump.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/zstreamdump/zstreamdump.c b/cmd/zstreamdump/zstreamdump.c
index 4c996ae55..ad3cefafc 100644
--- a/cmd/zstreamdump/zstreamdump.c
+++ b/cmd/zstreamdump/zstreamdump.c
@@ -117,7 +117,8 @@ read_hdr(dmu_replay_record_t *drr, zio_cksum_t *cksum)
sizeof (zio_cksum_t), cksum);
if (r == 0)
return (0);
- if (!ZIO_CHECKSUM_IS_ZERO(&drr->drr_u.drr_checksum.drr_checksum) &&
+ if (do_cksum &&
+ !ZIO_CHECKSUM_IS_ZERO(&drr->drr_u.drr_checksum.drr_checksum) &&
!ZIO_CHECKSUM_EQUAL(saved_cksum,
drr->drr_u.drr_checksum.drr_checksum)) {
fprintf(stderr, "invalid checksum\n");