summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 187be4012474..7c953b2ecf15 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -1319,6 +1319,12 @@ static int find_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
total_needed += empty_size;
path = btrfs_alloc_path();
check_failed:
+ if (!block_group) {
+ block_group = btrfs_lookup_block_group(info, search_start);
+ if (!block_group)
+ block_group = btrfs_lookup_block_group(info,
+ orig_search_start);
+ }
search_start = find_search_start(root, &block_group, search_start,
total_needed, data, full_scan);
search_start = stripe_align(root, search_start);
OpenPOWER on IntegriCloud