]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/btrfs/free-space-cache.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
[karo-tx-linux.git] / fs / btrfs / free-space-cache.c
index d20ff87ca603bba8255b04a95f34d11bb385ab33..c2f20594c9f74fde7e97cbdf4dea728b9c5a4bd8 100644 (file)
@@ -2242,7 +2242,7 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
                if (entry->bitmap) {
                        ret = btrfs_alloc_from_bitmap(block_group,
                                                      cluster, entry, bytes,
-                                                     min_start);
+                                                     cluster->window_start);
                        if (ret == 0) {
                                node = rb_next(&entry->offset_index);
                                if (!node)
@@ -2251,6 +2251,7 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
                                                 offset_index);
                                continue;
                        }
+                       cluster->window_start += bytes;
                } else {
                        ret = entry->offset;
 
@@ -2475,7 +2476,7 @@ setup_cluster_bitmap(struct btrfs_block_group_cache *block_group,
        }
 
        list_for_each_entry(entry, bitmaps, list) {
-               if (entry->bytes < min_bytes)
+               if (entry->bytes < bytes)
                        continue;
                ret = btrfs_bitmap_cluster(block_group, entry, cluster, offset,
                                           bytes, cont1_bytes, min_bytes);