HomeFreeBSD

make zdb_decompress_block check decompression reliably

Description

make zdb_decompress_block check decompression reliably

This function decompresses to two buffers and then compares them to
check whether the (opaque) decompression process filled the whole
buffer. Previously it began with lbuf uninitialized and lbuf2 filled
with pseudorandom data. This neither guarantees that any bytes not
written by the compressor would be different, nor seems incredibly
sound otherwise!

After these changes, instead of filling one buffer with generated
pseudorandom data we overwrite each buffer with completely different
data. This should remove the possibility of low-probability failures,
as well as make the process simpler and cheaper.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Kent Ross <k@mad.cash>
Closes #15733

Details

Provenance
Kent Ross <k@mad.cash>Authored on Jan 9 2024, 5:13 PM
GitHub <noreply@github.com>Committed on Jan 9 2024, 5:13 PM
Parents
rGbd3f90c0c1db: zpoolprops.7: Remove unnecessary .Ns
Branches
Unknown
Tags
Unknown