OSDN Git Service

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)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:57 +0000 (17:01 +0100)
commitfb2d83eefef4e1c717205bac71cb1941edf8ae11
tree641e169a18601367fa60f5dbaba8e2a969233bf3
parent8e19c9732ad1d127b5575a10f4fbcacf740500ff
btrfs: unset reloc control if we fail to recover

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>
fs/btrfs/relocation.c