Skip to content

Commit b263c2c

Browse files
committed
Btrfs: fix extent_buffer leak during tree log replay
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>
1 parent 0b4dcea commit b263c2c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/btrfs/tree-log.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3019,6 +3019,7 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree)
30193019
key.offset = found_key.offset - 1;
30203020
wc.replay_dest->log_root = NULL;
30213021
free_extent_buffer(log->node);
3022+
free_extent_buffer(log->commit_root);
30223023
kfree(log);
30233024

30243025
if (found_key.offset == 0)

0 commit comments

Comments
 (0)