]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: do not leak reloc root if we fail to read the fs root
authorJosef Bacik <josef@toxicpanda.com>
Fri, 6 Dec 2019 14:37:18 +0000 (09:37 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 28 Apr 2020 18:03:00 +0000 (19:03 +0100)
commitfcca68ca3d84ecedbb2adf478daecdfc71212e06
tree73ecd94ca4eb2c5603b5f2eee12335233695766f
parent78818411fd14f12213adbf1d0e5723784d0aa912
btrfs: do not leak reloc root if we fail to read the fs root

commit ca1aa2818a53875cfdd175fb5e9a2984e997cce9 upstream.

If we fail to read the fs root corresponding with a reloc root we'll
just break out and free the reloc roots.  But we remove our current
reloc_root from this list higher up, which means we'll leak this
reloc_root.  Fix this by adding ourselves back to the reloc_roots list
so we are properly cleaned up.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/btrfs/relocation.c