Wang Shilong
2014-Mar-18 12:02 UTC
[PATCH 1/6] 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> --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html