diff options
author | Kent Ross <k@mad.cash> | 2024-01-09 17:13:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-09 17:13:52 +0000 |
commit | 7ecaa0758005a56fa579c87a84a2a25ccd61033e (patch) | |
tree | 6202eaceaee2a0ff167c8c576c0121287c7a741e /cmd/zdb | |
parent | bd3f90c0c1db570aeebda52c3413662863f9129e (diff) | |
download | src-7ecaa0758005a56fa579c87a84a2a25ccd61033e.tar.gz src-7ecaa0758005a56fa579c87a84a2a25ccd61033e.zip |
Diffstat (limited to 'cmd/zdb')
-rw-r--r-- | cmd/zdb/zdb.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 777032bf82f6..cd934b2ae9ad 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -8533,11 +8533,14 @@ zdb_decompress_block(abd_t *pabd, void *buf, void *lbuf, uint64_t lsize, } /* - * We randomize lbuf2, and decompress to both - * lbuf and lbuf2. This way, we will know if - * decompression fill exactly to lsize. + * We set lbuf to all zeros and lbuf2 to all + * ones, then decompress to both buffers and + * compare their contents. This way we can + * know if decompression filled exactly to + * lsize or if it left some bytes unwritten. */ - VERIFY0(random_get_pseudo_bytes(lbuf2, lsize)); + memset(lbuf, 0x00, lsize); + memset(lbuf2, 0xff, lsize); if (zio_decompress_data(*cfuncp, pabd, lbuf, psize, lsize, NULL) == 0 && |