aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/free-space-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/free-space-cache.c')
-rw-r--r--fs/btrfs/free-space-cache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index d20ff87ca603..c2f20594c9f7 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -2242,7 +2242,7 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
2242 if (entry->bitmap) { 2242 if (entry->bitmap) {
2243 ret = btrfs_alloc_from_bitmap(block_group, 2243 ret = btrfs_alloc_from_bitmap(block_group,
2244 cluster, entry, bytes, 2244 cluster, entry, bytes,
2245 min_start); 2245 cluster->window_start);
2246 if (ret == 0) { 2246 if (ret == 0) {
2247 node = rb_next(&entry->offset_index); 2247 node = rb_next(&entry->offset_index);
2248 if (!node) 2248 if (!node)
@@ -2251,6 +2251,7 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
2251 offset_index); 2251 offset_index);
2252 continue; 2252 continue;
2253 } 2253 }
2254 cluster->window_start += bytes;
2254 } else { 2255 } else {
2255 ret = entry->offset; 2256 ret = entry->offset;
2256 2257
@@ -2475,7 +2476,7 @@ setup_cluster_bitmap(struct btrfs_block_group_cache *block_group,
2475 } 2476 }
2476 2477
2477 list_for_each_entry(entry, bitmaps, list) { 2478 list_for_each_entry(entry, bitmaps, list) {
2478 if (entry->bytes < min_bytes) 2479 if (entry->bytes < bytes)
2479 continue; 2480 continue;
2480 ret = btrfs_bitmap_cluster(block_group, entry, cluster, offset, 2481 ret = btrfs_bitmap_cluster(block_group, entry, cluster, offset,
2481 bytes, cont1_bytes, min_bytes); 2482 bytes, cont1_bytes, min_bytes);