]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix memory leak of empty filesystem after balance
authorliubo <liubo2009@cn.fujitsu.com>
Mon, 7 Mar 2011 02:13:33 +0000 (02:13 +0000)
committerroot <Chris Mason chris.mason@oracle.com>
Mon, 28 Mar 2011 09:37:52 +0000 (05:37 -0400)
commitfeec6e1f25f23919905ac0ec1f380e61fb79c07f
tree92037cbb39566fa8ba1b8a7644c8cb445be2c48a
parentd4dc7032b6f0799cd5a5d717d664e41f4e618355
Btrfs: fix memory leak of empty filesystem after balance

After Josef's patch(commit 3fd19cc0795104f010a85c250d579103fb7a5b36),
btrfs will exclude super bytes when reading block groups(by marking a extent
state UPTODATE).  However, these bytes do not get freed while balance remove
unused block groups, and we won't process those removed ones any more, when
we do umount and unload the btrfs module,  btrfs hits a memory leak.

This patch add the missing free operation.

Reproduce steps:
$ mkfs.btrfs disk
$ mount disk /mnt/btrfs -o loop
$ btrfs filesystem balance /mnt/btrfs
$ umount /mnt/btrfs
$ rmmod btrfs

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent-tree.c