HomeFreeBSD

ZAP: Fix leaf references on zap_expand_leaf() errors

Description

ZAP: Fix leaf references on zap_expand_leaf() errors

Depending on kind of error zap_expand_leaf() may return with or
without valid leaf reference held. Make sure it returns NULL if
due to error it has no leaf to return. Make its callers to check
the returned leaf pointer, and release the leaf if it is not NULL.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #12366
Closes #16159

Details

Provenance
mavAuthored on May 10 2024, 7:35 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on May 29 2024, 3:54 PM
Parents
rG4c484d66b7f8: Fix ZIL clone records for legacy holes
Branches
Unknown
Tags
Unknown