]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commitdiff
Btrfs: fix extent_buffer leak during tree log replay
authorChris Mason <chris.mason@oracle.com>
Thu, 11 Jun 2009 15:24:47 +0000 (11:24 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 11 Jun 2009 15:24:47 +0000 (11:24 -0400)
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>
fs/btrfs/tree-log.c

index 2b41fc08c34aade455ad42e7226003a1c89451bf..c13922206d1be59196a8c59c95f9a98bae12be74 100644 (file)
@@ -3019,6 +3019,7 @@ again:
                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)