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
GitHub <noreply@github.com>Committed on May 10 2024, 7:35 PM
Parents
rG41ae864b6999: Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN.
Branches
Unknown
Tags
Unknown