summaryrefslogtreecommitdiff
path: root/cmds-check.c
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2014-03-18 20:02:42 +0800
committerDavid Sterba <dsterba@suse.cz>2014-04-11 19:05:39 +0200
commit30e72cc70dda739b5b2dd87e00a42d00e49a9f01 (patch)
tree48390cf9e89de2a70c66d2dad175e26c1ce6549f /cmds-check.c
parent761650b628d3b8964cc55da68ad5c8187f55c543 (diff)
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>
Diffstat (limited to 'cmds-check.c')
-rw-r--r--cmds-check.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/cmds-check.c b/cmds-check.c
index 60708d05..74eeac73 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -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;
}