Btrfs-progs: use btrfs_lookup_first_block_group when fixing accounting
authorJosef Bacik <jbacik@fusionio.com>
Fri, 1 Feb 2013 17:00:32 +0000 (12:00 -0500)
committerDavid Sterba <dsterba@suse.cz>
Fri, 1 Feb 2013 16:56:42 +0000 (17:56 +0100)
commit2161e1b6f35d1c084fda49b479951219117c86e9
tree5cb0f1bb7e08a21a5fdeab878e0482121b1a3e32
parentaebc64f01e2fe70b822ea6c10ae67074ab1f2b7c
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 <jbacik@fusionio.com>
extent-tree.c