Removing ABD Parent Child Reference Before Freeing ABD
commit416015ef544183aa1310d7353f28b369f8b89928
authorBrian Atkinson <bwa@g.clemson.edu>
Thu, 28 Jan 2021 17:15:17 +0000 (28 10:15 -0700)
committerGitHub <noreply@github.com>
Thu, 28 Jan 2021 17:15:17 +0000 (28 09:15 -0800)
treec7a487bcb648f25dc377d1cebfc34271a9c119fa
parent393e69241eea8b5f7f817200ad283b7d5b5ceb70
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
module/zfs/abd.c