HomeFreeBSD

Removing ABD Parent Child Reference Before Freeing ABD

Description

Removing ABD Parent Child Reference Before Freeing ABD

Moving the call to zfs_refcount_remove_many() in abd_free() to be called
before any of the ABD free variants are called. This is necessary
because abd_free_gang() adjusts the abd_size for the gang ABD. If the
parent's child references are removed after free'ing the gang ABD the
refcount is not adjusted correctly for the parent's children.

I also removed some stray abd_put() in comments and changed
abd_free_gang_abd() -> abd_free_gang().

Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Brian Atkinson <batkinson@lanl.gov>
Closes #11539

Details

Provenance
Brian Atkinson <bwa@g.clemson.edu>Authored on Jan 28 2021, 5:15 PM
GitHub <noreply@github.com>Committed on Jan 28 2021, 5:15 PM
Parents
rG393e69241eea: Add zdb -r <dataset> <object-id | file> <output>
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG416015ef5441: Removing ABD Parent Child Reference Before Freeing ABD (authored by Brian Atkinson <bwa@g.clemson.edu>).Jan 28 2021, 5:15 PM