Skip to content
Commit 7785a663 authored by Filipe Manana's avatar Filipe Manana
Browse files

Btrfs: fix memory leaks after transaction is aborted



When a transaction is aborted, or its commit fails before writing the new
superblock and calling btrfs_finish_extent_commit(), we leak reference
counts on the block groups attached to the transaction's delete_bgs list,
because btrfs_finish_extent_commit() is never called for those two cases.
Fix this by dropping their references at btrfs_put_transaction(), which
is called when transactions are aborted (by making the transaction kthread
commit the transaction) or if their commits fail.

Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
parent 50460e37
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