Commit b263c2c8bf13c273485bd99dbbeba79c844409dd

Authored by Chris Mason
1 parent 0b4dcea579

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>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

... ... @@ -3019,6 +3019,7 @@
3019 3019 key.offset = found_key.offset - 1;
3020 3020 wc.replay_dest->log_root = NULL;
3021 3021 free_extent_buffer(log->node);
  3022 + free_extent_buffer(log->commit_root);
3022 3023 kfree(log);
3023 3024  
3024 3025 if (found_key.offset == 0)