aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2009-07-24 16:30:55 -0400
committerChris Mason <chris.mason@oracle.com>2009-07-24 16:30:55 -0400
commit283bb1979fa8580c4037d8df251449368c292a3b (patch)
tree4207fcd1e595cfb4074b719fd22e70277e72464f /fs/btrfs/extent-tree.c
parentebecd3d9d2adba144c15f1d35c78e0c26ead1bfd (diff)
Btrfs: clear all space_info->full after removing a block group
Btrfs allocates individual extents from block groups, and each block group has a specific type. It may hold metadata, data mirrored or striped etc. When we balance space (btrfs-vol -b) or remove a drive (btrfs-vol -r) we free block groups. Once a block group is freed, the space it was using on the device may be available for use by new block groups. btrfs_remove_block_group was clearing the flag that said 'our devices are full, don't even try to allocate new block groups', but it was only clearing that flag for a specific type of block group. This commit clears the full flag for all of the types of block groups, making it much more likely that we'll be able to balance space when the drive is close to full. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 9a489cc89fd3..508df5f7d2ea 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -7486,7 +7486,8 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
7486 block_group->space_info->total_bytes -= block_group->key.offset; 7486 block_group->space_info->total_bytes -= block_group->key.offset;
7487 block_group->space_info->bytes_readonly -= block_group->key.offset; 7487 block_group->space_info->bytes_readonly -= block_group->key.offset;
7488 spin_unlock(&block_group->space_info->lock); 7488 spin_unlock(&block_group->space_info->lock);
7489 block_group->space_info->full = 0; 7489
7490 btrfs_clear_space_info_full(root->fs_info);
7490 7491
7491 btrfs_put_block_group(block_group); 7492 btrfs_put_block_group(block_group);
7492 btrfs_put_block_group(block_group); 7493 btrfs_put_block_group(block_group);