Btrfs: Fix cluster window start
PATCH 1/1 Btrfs: Fix cluster window start
We use cluster->window_start as a hint of where to find the block group for our allocation. The problem is we also use this offset as a minimum starting offset when we look through our cluster for allocations. So what happens is we end up setting this offset to whatever the last entry we found was, so if there happen to be multiple entries, every allocation after the first one once we've refilled the cluster will fail, and we'll have to refill the cluster. Fix this by setting cluster->window_start to window_start, which is the offset of the _first_ entry we find in this cluster.
Signed-off-by Josef Bacik <[email protected]>
--- fs/btrfs/free-space-cache.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
fs/btrfs/free-space-cache.c +1 -2
@@ -1305,8 +1305,6 @@ again: } } - cluster->window_start = entry->offset; -/* * now we've found our entries, pull them out of the free space * cache and put them into the cluster rbtree
@@ -1336,6 +1334,7 @@ again: } cluster->max_size = max_extent; + cluster->window_start = window_start; got_it: ret =0 ;atomic_inc (&block_group->count);
Signature · 1 line
1.6.2.5