]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: unset reloc control if we fail to recover
authorJosef Bacik <josef@toxicpanda.com>
Wed, 4 Mar 2020 16:18:25 +0000 (11:18 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 14:13:36 +0000 (16:13 +0200)
commit9b8fda769d8a11ea0e7905042af459039d202294
treefea03a64d4ff2ea172f8e2ca35bc103114a16a93
parent496567527d8f674a293558b07b975b19f8429df6
btrfs: unset reloc control if we fail to recover

commit fb2d83eefef4e1c717205bac71cb1941edf8ae11 upstream.

If we fail to load an fs root, or fail to start a transaction we can
bail without unsetting the reloc control, which leads to problems later
when we free the reloc control but still have it attached to the file
system.

In the normal path we'll end up calling unset_reloc_control() twice, but
all it does is set fs_info->reloc_control = NULL, and we can only have
one balance at a time so it's not racey.

CC: stable@vger.kernel.org # 5.4+
Reviewed-by: Qu Wenruo <wqu@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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/relocation.c