HomeFreeBSD

Fix bad kmem_free() in zvol_rename_minors_impl()

Description

Fix bad kmem_free() in zvol_rename_minors_impl()

Currently, zvol_rename_minors_impl() calls kmem_asprintf()
to allocate and initialize a string. This function is a thin
wrapper around the kernel's kvasprintf() and does not call
into the SPL's kmem tracking code when it is enabled. However,
this function frees the string with the tracked kmem_free()
instead of the untracked strfree(), which causes the SPL
kmem tracking code to believe that the function is attempting
to free memory it never allocated, triggering an ASSERT. This
patch simply corrects this issue.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8307

Details

Provenance
Tom Caputi <tcaputi@datto.com>Authored on Jan 23 2019, 7:38 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jan 23 2019, 7:38 PM
Parents
rG0a10863194b0: ztest: creates partially initialized root dataset
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGb5d693581d62: Fix bad kmem_free() in zvol_rename_minors_impl() (authored by Tom Caputi <tcaputi@datto.com>).Jan 23 2019, 7:38 PM