* [PATCH] Btrfs-progs: use btrfs_lookup_first_block_group when fixing accounting
@ 2013-02-01 17:00 Josef Bacik
0 siblings, 0 replies; only message in thread
From: Josef Bacik @ 2013-02-01 17:00 UTC (permalink / raw)
To: linux-btrfs
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 | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/extent-tree.c b/extent-tree.c
index 20cdffa..10cc995 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;
--
1.7.7.6
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-02-01 16:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-01 17:00 [PATCH] Btrfs-progs: use btrfs_lookup_first_block_group when fixing accounting Josef Bacik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).