|
@@ -3744,8 +3744,15 @@ void btrfs_drop_and_free_fs_root(struct btrfs_fs_info *fs_info,
|
|
|
if (btrfs_root_refs(&root->root_item) == 0)
|
|
|
synchronize_srcu(&fs_info->subvol_srcu);
|
|
|
|
|
|
- if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state))
|
|
|
+ if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) {
|
|
|
btrfs_free_log(NULL, root);
|
|
|
+ if (root->reloc_root) {
|
|
|
+ free_extent_buffer(root->reloc_root->node);
|
|
|
+ free_extent_buffer(root->reloc_root->commit_root);
|
|
|
+ btrfs_put_fs_root(root->reloc_root);
|
|
|
+ root->reloc_root = NULL;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if (root->free_ino_pinned)
|
|
|
__btrfs_remove_free_space_cache(root->free_ino_pinned);
|