path: root/extent-tree.c
diff options
authorJosef Bacik <>2013-02-01 12:00:32 -0500
committerDavid Sterba <>2013-02-01 17:56:42 +0100
commit2161e1b6f35d1c084fda49b479951219117c86e9 (patch)
tree5cb0f1bb7e08a21a5fdeab878e0482121b1a3e32 /extent-tree.c
parentaebc64f01e2fe70b822ea6c10ae67074ab1f2b7c (diff)
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 <>
Diffstat (limited to 'extent-tree.c')
1 files changed, 1 insertions, 1 deletions
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)
start = cache->key.objectid + cache->key.offset;