On Sat, Jun 13, 2015 at 06:52:56AM +0100, [email protected] wrote:
> From: Filipe Manana <[email protected]>
> 
> The free space entries are allocated using kmem_cache_zalloc(),
> through __btrfs_add_free_space(), therefore we should use
> kmem_cache_free() and not kfree() to avoid any confusion and
> any potential problem. Looking at the kfree() definition at
> mm/slab.c it has the following comment:
> 
>   /*
>    * (...)
>    *
>    * Don't free memory not originally allocated by kmalloc()
>    * or you will run into trouble.
>    */
> 
> So better be safe and use kmem_cache_free().
> 
> Cc: [email protected]
> Signed-off-by: Filipe Manana <[email protected]>

Reviewed-by: David Sterba <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to