Skip to content

Commit b0e4e15

Browse files
maharmstonekdave
authored andcommitted
btrfs-progs: use btrfs_lookup_block_group() in check_free_space_tree()
check_free_space_tree() is intended to check that the free-space tree doesn't contain any entries which don't correspond to a block group. Unfortunately it calls btrfs_lookup_first_block_group(), which only returns NULL if the search offset is larger than the start of any block group. Fix check_free_space_tree() to use btrfs_lookup_block_group() as was obviously intended, and fix fsck-tests/054-orphan-directory to get rid of its spurious free-space entries that this now diagnoses. Signed-off-by: Mark Harmstone <mark@harmstone.com>
1 parent 97d22be commit b0e4e15

File tree

3 files changed

+1
-1
lines changed

3 files changed

+1
-1
lines changed

common/clear-cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static int check_free_space_tree(struct btrfs_root *root)
164164
goto out;
165165
}
166166

167-
bg = btrfs_lookup_first_block_group(fs_info, key.objectid);
167+
bg = btrfs_lookup_block_group(fs_info, key.objectid);
168168
if (!bg) {
169169
fprintf(stderr,
170170
"We have a space info key for a block group that doesn't exist\n");
-16 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)