Btrfs: fix memory leak of block group cache
authorLiu Bo <bo.li.liu@oracle.com>
Thu, 21 Jul 2016 00:44:12 +0000 (17:44 -0700)
committerDavid Sterba <dsterba@suse.com>
Tue, 6 Sep 2016 16:35:29 +0000 (18:35 +0200)
commitde26dfdea8048148f6faec06387cee88cc5a69b3
treea2c68c3319a9edce3878903115176ef8f4210efa
parentc6935931c1894ff857616ff8549b61236a19148f
Btrfs: fix memory leak of block group cache

While processing delayed refs, we may update block group's statistics
and attach it to cur_trans->dirty_bgs, and later writing dirty block
groups will process the list, which happens during
btrfs_commit_transaction().

For whatever reason, the transaction is aborted and dirty_bgs
is not processed in cleanup_transaction(), we end up with memory leak
of these dirty block group cache.

Since btrfs_start_dirty_block_groups() doesn't make it go to the commit
critical section, this also adds the cleanup work inside it.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/extent-tree.c
This page took 0.024573 seconds and 5 git commands to generate.