aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index a80b97100d90..a684086c3c81 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3139,9 +3139,11 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans,
3139 struct extent_buffer *leaf; 3139 struct extent_buffer *leaf;
3140 3140
3141 ret = btrfs_search_slot(trans, extent_root, &cache->key, path, 0, 1); 3141 ret = btrfs_search_slot(trans, extent_root, &cache->key, path, 0, 1);
3142 if (ret < 0) 3142 if (ret) {
3143 if (ret > 0)
3144 ret = -ENOENT;
3143 goto fail; 3145 goto fail;
3144 BUG_ON(ret); /* Corruption */ 3146 }
3145 3147
3146 leaf = path->nodes[0]; 3148 leaf = path->nodes[0];
3147 bi = btrfs_item_ptr_offset(leaf, path->slots[0]); 3149 bi = btrfs_item_ptr_offset(leaf, path->slots[0]);
@@ -3149,11 +3151,9 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans,
3149 btrfs_mark_buffer_dirty(leaf); 3151 btrfs_mark_buffer_dirty(leaf);
3150 btrfs_release_path(path); 3152 btrfs_release_path(path);
3151fail: 3153fail:
3152 if (ret) { 3154 if (ret)
3153 btrfs_abort_transaction(trans, root, ret); 3155 btrfs_abort_transaction(trans, root, ret);
3154 return ret; 3156 return ret;
3155 }
3156 return 0;
3157 3157
3158} 3158}
3159 3159
@@ -9422,7 +9422,6 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
9422 * are still on the list after taking the semaphore 9422 * are still on the list after taking the semaphore
9423 */ 9423 */
9424 list_del_init(&block_group->list); 9424 list_del_init(&block_group->list);
9425 list_del_init(&block_group->ro_list);
9426 if (list_empty(&block_group->space_info->block_groups[index])) { 9425 if (list_empty(&block_group->space_info->block_groups[index])) {
9427 kobj = block_group->space_info->block_group_kobjs[index]; 9426 kobj = block_group->space_info->block_group_kobjs[index];
9428 block_group->space_info->block_group_kobjs[index] = NULL; 9427 block_group->space_info->block_group_kobjs[index] = NULL;
@@ -9464,6 +9463,7 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
9464 btrfs_remove_free_space_cache(block_group); 9463 btrfs_remove_free_space_cache(block_group);
9465 9464
9466 spin_lock(&block_group->space_info->lock); 9465 spin_lock(&block_group->space_info->lock);
9466 list_del_init(&block_group->ro_list);
9467 block_group->space_info->total_bytes -= block_group->key.offset; 9467 block_group->space_info->total_bytes -= block_group->key.offset;
9468 block_group->space_info->bytes_readonly -= block_group->key.offset; 9468 block_group->space_info->bytes_readonly -= block_group->key.offset;
9469 block_group->space_info->disk_total -= block_group->key.offset * factor; 9469 block_group->space_info->disk_total -= block_group->key.offset * factor;