HomeFreeBSD

zio_compress_data: limit dest length to ABD size

Description

zio_compress_data: limit dest length to ABD size

Some callers (eg do_corrective_recv()) pass in a dest buffer much
smaller than the wanted 87.5% of the source buffer, because the
incoming abd is larger than the source data and they "know" what the
decompressed size with be.

However, abd_borrow_buf() rightly asserts if we try to borrow more
than is available, so these callers fail.

Previously when all we had was a dest buffer, we didn't know how big it
was, so we couldn't do anything. Now we have a dest abd, with a size, so
we can clamp dest size to the abd size.

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 5 2024, 3:39 AM
Tony Hutter <hutter2@llnl.gov>Committed on Aug 22 2024, 11:22 PM
Parents
rGf62e6e1f985b: compress: change zio_compress API to use ABDs
Branches
Unknown
Tags
Unknown