Commit b263c2c8 authored by Chris Mason's avatar Chris Mason
Browse files

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: default avatarChris Mason <>
parent 0b4dcea5
...@@ -3019,6 +3019,7 @@ again: ...@@ -3019,6 +3019,7 @@ again:
key.offset = found_key.offset - 1; key.offset = found_key.offset - 1;
wc.replay_dest->log_root = NULL; wc.replay_dest->log_root = NULL;
free_extent_buffer(log->node); free_extent_buffer(log->node);
kfree(log); kfree(log);
if (found_key.offset == 0) if (found_key.offset == 0)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment