diff mbox

[1/6] Btrfs-progs: fsck: don't free @seen cache until we finish searching

Message ID 1395144167-775-1-git-send-email-wangsl.fnst@cn.fujitsu.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Wang Shilong March 18, 2014, 12:02 p.m. UTC
@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>
---
 cmds-check.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
diff mbox

Patch

diff --git a/cmds-check.c b/cmds-check.c
index d1cafe1..c0b7f8c 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;
 }