diff options
author | Josef Bacik <josef@toxicpanda.com> | 2020-01-24 09:32:55 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-03-23 17:01:32 +0100 |
commit | 81f096edf0472864879e1e5a7f0fdf87ea90fe75 (patch) | |
tree | ab31121667e046139480130429cee05d017e5e86 /fs/btrfs/tree-log.c | |
parent | 4c78e9f59632b5e635e51db9b68111288b38ff22 (diff) |
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>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 169270c931a9..1776ac466f02 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -3289,7 +3289,7 @@ static void free_log_tree(struct btrfs_trans_handle *trans, clear_extent_bits(&log->dirty_log_pages, 0, (u64)-1, EXTENT_DIRTY | EXTENT_NEW | EXTENT_NEED_WAIT); free_extent_buffer(log->node); - kfree(log); + btrfs_put_fs_root(log); } /* @@ -6187,7 +6187,7 @@ again: log->node->len); free_extent_buffer(log->node); free_extent_buffer(log->commit_root); - kfree(log); + btrfs_put_fs_root(log); if (!ret) goto next; @@ -6226,7 +6226,7 @@ again: btrfs_put_fs_root(wc.replay_dest); free_extent_buffer(log->node); free_extent_buffer(log->commit_root); - kfree(log); + btrfs_put_fs_root(log); if (ret) goto error; @@ -6260,7 +6260,7 @@ next: free_extent_buffer(log_root_tree->node); log_root_tree->log_root = NULL; clear_bit(BTRFS_FS_LOG_RECOVERING, &fs_info->flags); - kfree(log_root_tree); + btrfs_put_fs_root(log_root_tree); return 0; error: |