Skip to content

Commit

Permalink
Btrfs: Don't corrupt ram in shrink_extent_tree, leak it instead
Browse files Browse the repository at this point in the history
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 <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent 9ca9ee0 commit d7a029a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3437,8 +3437,10 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 shrink_start)
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);
Expand Down

0 comments on commit d7a029a

Please sign in to comment.