From: Josef Bacik Date: Wed, 11 Nov 2009 02:23:48 +0000 (-0500) Subject: Btrfs: fix how we set max_size for free space clusters X-Git-Tag: v2.6.32-rc7~36^2~7 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=01dea1efc23b511d3b58bb94da07ddb6d6db9895;p=~shefty%2Frdma-dev.git Btrfs: fix how we set max_size for free space clusters This patch fixes a problem where max_size can be set to 0 even though we filled the cluster properly. We set max_size to 0 if we restart the cluster window, but if the new start entry is big enough to be our new cluster then we could return with a max_size set to 0, which will mean the next time we try to allocate from this cluster it will fail. So set max_extent to the entry's size. Tested this on my box and now we actually allocate from the cluster after we fill it. Thanks, Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 5c2caad7621..cb2849f0325 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -1296,7 +1296,7 @@ again: window_start = entry->offset; window_free = entry->bytes; last = entry; - max_extent = 0; + max_extent = entry->bytes; } else { last = next; window_free += next->bytes;