diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 0d98aee34fee..1e60d00d4ea7 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -2847,6 +2847,8 @@ int open_ctree(struct super_block *sb, | |||
2847 | !extent_buffer_uptodate(chunk_root->node)) { | 2847 | !extent_buffer_uptodate(chunk_root->node)) { |
2848 | printk(KERN_ERR "BTRFS: failed to read chunk root on %s\n", | 2848 | printk(KERN_ERR "BTRFS: failed to read chunk root on %s\n", |
2849 | sb->s_id); | 2849 | sb->s_id); |
2850 | if (!IS_ERR(chunk_root->node)) | ||
2851 | free_extent_buffer(chunk_root->node); | ||
2850 | chunk_root->node = NULL; | 2852 | chunk_root->node = NULL; |
2851 | goto fail_tree_roots; | 2853 | goto fail_tree_roots; |
2852 | } | 2854 | } |
@@ -2885,6 +2887,8 @@ retry_root_backup: | |||
2885 | !extent_buffer_uptodate(tree_root->node)) { | 2887 | !extent_buffer_uptodate(tree_root->node)) { |
2886 | printk(KERN_WARNING "BTRFS: failed to read tree root on %s\n", | 2888 | printk(KERN_WARNING "BTRFS: failed to read tree root on %s\n", |
2887 | sb->s_id); | 2889 | sb->s_id); |
2890 | if (!IS_ERR(tree_root->node)) | ||
2891 | free_extent_buffer(tree_root->node); | ||
2888 | tree_root->node = NULL; | 2892 | tree_root->node = NULL; |
2889 | goto recovery_tree_root; | 2893 | goto recovery_tree_root; |
2890 | } | 2894 | } |
@@ -3765,9 +3769,7 @@ void close_ctree(struct btrfs_root *root) | |||
3765 | * block groups queued for removal, the deletion will be | 3769 | * block groups queued for removal, the deletion will be |
3766 | * skipped when we quit the cleaner thread. | 3770 | * skipped when we quit the cleaner thread. |
3767 | */ | 3771 | */ |
3768 | mutex_lock(&root->fs_info->cleaner_mutex); | ||
3769 | btrfs_delete_unused_bgs(root->fs_info); | 3772 | btrfs_delete_unused_bgs(root->fs_info); |
3770 | mutex_unlock(&root->fs_info->cleaner_mutex); | ||
3771 | 3773 | ||
3772 | ret = btrfs_commit_super(root); | 3774 | ret = btrfs_commit_super(root); |
3773 | if (ret) | 3775 | if (ret) |