btrfs: use btrfs_put_fs_root to free roots always

If we are going to track leaked roots we need to free them all the same
way, so don't kfree() roots directly, use btrfs_put_fs_root.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Josef Bacik
2020-01-24 09:32:55 -05:00
committed by David Sterba
parent 4c78e9f596
commit 81f096edf0
5 changed files with 23 additions and 23 deletions

View File

@@ -227,7 +227,7 @@ void btrfs_free_dummy_root(struct btrfs_root *root)
/* One for allocate_extent_buffer */
free_extent_buffer(root->node);
}
kfree(root);
btrfs_put_fs_root(root);
}
struct btrfs_block_group *