HomeFreeBSD

zstream recompress: fix zero recompressed buffer and output

Description

zstream recompress: fix zero recompressed buffer and output

If compression happend, any garbage past the compress size was not
zeroed out.

If compression didn't happen, then the payload size was still set to
the rounded-up return from zio_compress_data(), which is dependent on
the input, which is not necessarily the logical size.

So that's all fixed too, mostly from stealing the math from zio.c.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>

Details

Provenance
rob.norris_klarasystems.comAuthored on Jul 23 2024, 1:43 AM
Tony Hutter <hutter2@llnl.gov>Committed on Aug 22 2024, 11:22 PM
Parents
rGa537d90734a1: zstream decompress: fix decompress size and output
Branches
Unknown
Tags
Unknown