From 2161e1b6f35d1c084fda49b479951219117c86e9 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Fri, 1 Feb 2013 12:00:32 -0500 Subject: Btrfs-progs: use btrfs_lookup_first_block_group when fixing accounting This was a bug from long time ago that never actually got fixed. We start with bytenr 0 when looping through all of the block groups, but btrfs_lookup_block_group will bail out since it couldn't find a block group with 0 as the bytenr. Btrfs_lookup_first_block_group will be nice and adjust the start up to the right value, so this way we reset all the block groups properly and not screw up the users block group accounting. Thanks, Signed-off-by: Josef Bacik --- extent-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extent-tree.c') diff --git a/extent-tree.c b/extent-tree.c index 20cdffa8..10cc995b 100644 --- a/extent-tree.c +++ b/extent-tree.c @@ -3406,7 +3406,7 @@ int btrfs_fix_block_accounting(struct btrfs_trans_handle *trans, } while(1) { - cache = btrfs_lookup_block_group(fs_info, start); + cache = btrfs_lookup_first_block_group(fs_info, start); if (!cache) break; start = cache->key.objectid + cache->key.offset; -- cgit v1.2.3