All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] Btrfs-progs: fsck: don't free @seen cache until we finish searching
@ 2014-03-18 12:02 Wang Shilong
  2014-03-18 12:02 ` [PATCH 2/6] Btrfs-progs: fsck: fix possible memory leaks in run_next_block() Wang Shilong
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Wang Shilong @ 2014-03-18 12:02 UTC (permalink / raw)
  To: linux-btrfs

@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 --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;
 }
 
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-03-19  1:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-18 12:02 [PATCH 1/6] Btrfs-progs: fsck: don't free @seen cache until we finish searching Wang Shilong
2014-03-18 12:02 ` [PATCH 2/6] Btrfs-progs: fsck: fix possible memory leaks in run_next_block() Wang Shilong
2014-03-18 12:02 ` [PATCH 3/6] Btrfs-progs: fsck: deal with snapshot one by one when rebuilding extent tree Wang Shilong
2014-03-18 12:02 ` [PATCH 4/6] Btrfs-progs: fsck: add ability to rebuild extent tree with snapshots Wang Shilong
2014-03-18 12:02 ` [PATCH 5/6] Btrfs-progs: fsck: reduce memory usage of extent record struct Wang Shilong
2014-03-18 18:18   ` David Sterba
2014-03-19  1:11     ` Wang Shilong
2014-03-18 12:02 ` [PATCH 6/6] Btrfs-progs: fsck: fix wrong index in pick_next_pending() Wang Shilong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.