Btrfs: Add check for null block group to find_search_start
authorChris Mason <chris.mason@oracle.com>
Mon, 26 Nov 2007 15:55:49 +0000 (10:55 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:03:58 +0000 (11:03 -0400)
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent-tree.c

index 6a7a9ba75fd9a95ff46dbb988f30d305e227ba21..39be6baccc36fa119efdec09d11f199faee9b24f 100644 (file)
@@ -204,6 +204,7 @@ new_group:
 wrapped:
        cache = btrfs_lookup_block_group(root->fs_info, last);
        if (!cache) {
+no_cache:
                if (!wrapped) {
                        wrapped = 1;
                        last = search_start;
@@ -219,6 +220,8 @@ wrapped:
        }
        if (!full_scan)
                cache = btrfs_find_block_group(root, cache, last, data, 0);
+       if (!cache)
+               goto no_cache;
        *cache_ret = cache;
        cache_miss = 0;
        goto again;