]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: use free_root_extent_buffer to free root
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Tue, 23 Jun 2020 08:40:07 +0000 (17:40 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:27 +0000 (12:55 +0200)
commit442fa5b29e91ccfe401e36b1baa347106b85699a
tree8dc1ea29912fc8a05fa01ec2813ab83bfcafacff
parent992647a2c3a2dff8f5ea041577dc2906a39eabd2
btrfs: use free_root_extent_buffer to free root

In btrfs_put_root() we're freeing a btrfs_root's 'node' and 'commit_root'
extent buffers manually via kfree(), while we're using
free_root_extent_buffers() in the free_root_pointers() function above.

free_root_extent_buffers() also NULLs the pointers after freeing, which
mitigates potential double frees.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c