HomeFreeBSD

abd_iter_page: rework to handle multipage scatterlists

Description

abd_iter_page: rework to handle multipage scatterlists

Previously, abd_iter_page() would assume that every scatterlist would
contain a single page (compound or no), because that's all we ever
create in abd_alloc_chunks(). However, scatterlists can contain multiple
pages of arbitrary provenance, and if we get one of those, we'd get all
the math wrong.

This reworks things to handle multiple pages in a scatterlist, by
properly finding the right page within it for the given offset, and
understanding better where the end of the page is and not crossing it.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reported-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16108

Details

Provenance
rob.norris_klarasystems.comAuthored on Apr 19 2024, 11:41 PM
Tony Hutter <hutter2@llnl.gov>Committed on Jul 17 2024, 9:54 PM
Parents
rGad8c8c1e31f9: zts: add a debug option to get full test output
Branches
Unknown
Tags
Unknown