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.

Signed-off-by: Josef Bacik <>
Signed-off-by: David Sterba <>
Signed-off-by: Greg Kroah-Hartman <>

1 file changed