aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/extent-tree.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 7a14a4aa50a7..be4a79a69ed1 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -9732,9 +9732,19 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
9732 9732
9733 spin_lock(&block_group->space_info->lock); 9733 spin_lock(&block_group->space_info->lock);
9734 list_del_init(&block_group->ro_list); 9734 list_del_init(&block_group->ro_list);
9735
9736 if (btrfs_test_opt(root, ENOSPC_DEBUG)) {
9737 WARN_ON(block_group->space_info->total_bytes
9738 < block_group->key.offset);
9739 WARN_ON(block_group->space_info->bytes_readonly
9740 < block_group->key.offset);
9741 WARN_ON(block_group->space_info->disk_total
9742 < block_group->key.offset * factor);
9743 }
9735 block_group->space_info->total_bytes -= block_group->key.offset; 9744 block_group->space_info->total_bytes -= block_group->key.offset;
9736 block_group->space_info->bytes_readonly -= block_group->key.offset; 9745 block_group->space_info->bytes_readonly -= block_group->key.offset;
9737 block_group->space_info->disk_total -= block_group->key.offset * factor; 9746 block_group->space_info->disk_total -= block_group->key.offset * factor;
9747
9738 spin_unlock(&block_group->space_info->lock); 9748 spin_unlock(&block_group->space_info->lock);
9739 9749
9740 memcpy(&key, &block_group->key, sizeof(key)); 9750 memcpy(&key, &block_group->key, sizeof(key));