Skip to content

Commit

Permalink
Btrfs: fix extent_buffer leak during tree log replay
Browse files Browse the repository at this point in the history
During tree log replay, we read in the tree log roots,
process them and then free them.  A recent change
takes an extra reference on the root node of the tree
when the root is read in, and stores that reference
in root->commit_root.

This reference was not being freed, leaving us with
one buffer pinned in ram for each subvol with
a tree log root after a crash.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Jun 11, 2009
1 parent 0b4dcea commit b263c2c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/btrfs/tree-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -3019,6 +3019,7 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree)
key.offset = found_key.offset - 1;
wc.replay_dest->log_root = NULL;
free_extent_buffer(log->node);
free_extent_buffer(log->commit_root);
kfree(log);

if (found_key.offset == 0)
Expand Down

0 comments on commit b263c2c

Please sign in to comment.