btrfs: free the reloc_control in a consistent way
authorJosef Bacik <josef@toxicpanda.com>
Wed, 4 Mar 2020 16:18:26 +0000 (11:18 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:57 +0000 (17:01 +0100)
commit1a0afa0ecfc4dbc8d7583d03cafd3f68f781df0c
tree6a88a2066d1c7b978200019ea52d83c276166047
parent2abc726ab4b83db774e315c660ab8da21477092f
btrfs: free the reloc_control in a consistent way

If we have an error while processing the reloc roots we could leak roots
that were added to rc->reloc_roots before we hit the error.  We could
have also not removed the reloc tree mapping from our rb_tree, so clean
up any remaining nodes in the reloc root rb_tree.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ use rbtree_postorder_for_each_entry_safe ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/relocation.c