Skip to content

Commit

Permalink
Btrfs: reset cluster's max_size when creating bitmap
Browse files Browse the repository at this point in the history
The field that indicates the size of the largest contiguous chunk of
free space in the cluster is not initialized when setting up bitmaps,
it's only increased when we find a larger contiguous chunk.  We end up
retaining a larger value than appropriate for highly-fragmented
clusters, which may cause pointless searches for large contiguous
groups, and even cause clusters that do not meet the density
requirements to be set up.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Alexandre Oliva authored and Chris Mason committed Nov 30, 2011
1 parent f2d0f67 commit b78d09b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/btrfs/free-space-cache.c
Original file line number Diff line number Diff line change
@@ -2320,6 +2320,7 @@ static int btrfs_bitmap_cluster(struct btrfs_block_group_cache *block_group,

if (!found) {
start = i;
cluster->max_size = 0;
found = true;
}

0 comments on commit b78d09b

Please sign in to comment.