Btrfs-progs: fsck: don't free @seen cache until we finish searching

@seen cache is used to avoid iterating same block more than once, and
we can not free them until we have finished searching.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
master
Wang Shilong 2014-03-18 20:02:42 +08:00 committed by David Sterba
parent 761650b628
commit 30e72cc70d
1 changed files with 1 additions and 6 deletions

View File

@ -3892,12 +3892,6 @@ static int run_next_block(struct btrfs_trans_handle *trans,
remove_cache_extent(nodes, cache);
free(cache);
}
cache = lookup_cache_extent(seen, bytenr, size);
if (cache) {
remove_cache_extent(seen, cache);
free(cache);
}
cache = lookup_cache_extent(extent_cache, bytenr, size);
if (cache) {
struct extent_record *rec;
@ -5914,6 +5908,7 @@ out:
free_device_cache_tree(&dev_cache);
free_block_group_tree(&block_group_cache);
free_device_extent_tree(&dev_extent_cache);
free_extent_cache_tree(&seen);
return ret;
}