Btrfs: don't leak reloc root nodes on error
authorJosef Bacik <jbacik@fb.com>
Fri, 2 Sep 2016 19:25:43 +0000 (15:25 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jan 2017 10:16:10 +0000 (11:16 +0100)
commit5a9b659edef60fb665786525528086b5df5e0e19
tree5e9a6d95caf18464721104fa5a54ee92b2a31223
parent8ca6845a58cda0cda9359eb313af35c2f88df073
Btrfs: don't leak reloc root nodes on error

commit 6bdf131fac2336adb1a628f992ba32384f653a55 upstream.

We don't track the reloc roots in any sort of normal way, so the only way the
root/commit_root nodes get free'd is if the relocation finishes successfully and
the reloc root is deleted.  Fix this by free'ing them in free_reloc_roots.
Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/relocation.c