aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2020-02-28 14:30:21 -0500
committerJosef Bacik <josef@toxicpanda.com>2020-02-28 14:30:21 -0500
commitbfacd1b8bf312264bd511d58f7dd980734bcf9b0 (patch)
tree4a469e0f744aff3f13ead77f57769293fa4868af
parent1bfc23d8eae41161821513a48703ed38d6fd0cff (diff)
downloadbtrfs-next-bfacd1b8bf312264bd511d58f7dd980734bcf9b0.tar.gz
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. Signed-off-by: Josef Bacik <josef@toxicpanda.com>
-rw-r--r--fs/btrfs/relocation.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 507361e9931658..173fc7628235a9 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -4678,6 +4678,7 @@ int btrfs_recover_relocation(struct btrfs_root *root)
fs_root = read_fs_root(fs_info, reloc_root->root_key.offset);
if (IS_ERR(fs_root)) {
err = PTR_ERR(fs_root);
+ unset_reloc_control(rc);
list_add_tail(&reloc_root->root_list, &reloc_roots);
goto out_free;
}
@@ -4689,8 +4690,10 @@ int btrfs_recover_relocation(struct btrfs_root *root)
}
err = btrfs_commit_transaction(trans);
- if (err)
+ if (err) {
+ unset_reloc_control(rc);
goto out_free;
+ }
merge_reloc_roots(rc);