From: Chris Mason Date: Tue, 5 Aug 2008 03:17:26 +0000 (-0400) Subject: Btrfs: Don't corrupt ram in shrink_extent_tree, leak it instead X-Git-Tag: upstream/snapshot3+hdmi~20477^2~11^2~55^2~56^2~30^2~68 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d7a029a89ef370e74b63f18b81498d90d1ee3cc1;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git Btrfs: Don't corrupt ram in shrink_extent_tree, leak it instead Far from the perfect fix, but these structs are small. TODO for the next release. The block group cache structs are referenced in many different places, and it isn't safe to just free them while resizing. A real fix will be a larger change to the allocator so that it doesn't have to carry about the block group cache structs to find good places to search for free blocks. Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 1aeb695..dbde128 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3437,8 +3437,10 @@ next: key.objectid, key.objectid + key.offset - 1, (unsigned int)-1, GFP_NOFS); + /* memset(shrink_block_group, 0, sizeof(*shrink_block_group)); kfree(shrink_block_group); + */ btrfs_del_item(trans, root, path); btrfs_release_path(root, path);