소스 검색

Btrfs: Add check for null block group to find_search_start

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Chris Mason 17 년 전
부모
커밋
0e4de58432
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      fs/btrfs/extent-tree.c

+ 3 - 0
fs/btrfs/extent-tree.c

@@ -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;