From: Filipe David Borba Manana Date: Mon, 7 Oct 2013 11:04:28 +0000 (+0100) Subject: Btrfs: fix memory leaks on transaction commit failure X-Git-Tag: v3.13-rc1~85^2~71 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80d94fb3df2bf24a500f13181921736fa23b6c3d;p=pandora-kernel.git Btrfs: fix memory leaks on transaction commit failure Structures of the types tree_mod_elem and qgroup_update are allocated during transaction commit but were not being released if the call to btrfs_run_delayed_items() returned an error. Stack trace reported by kmemleak: unreferenced object 0xffff880679f0b398 (size 128): comm "umount", pid 21508, jiffies 4295967793 (age 36718.112s) hex dump (first 32 bytes): 60 b5 f0 79 06 88 ff ff 00 00 00 00 00 00 00 00 `..y............ 00 00 00 00 00 00 00 00 50 1c 00 00 00 00 00 00 ........P....... backtrace: [] kmemleak_alloc+0x26/0x50 [] kmem_cache_alloc_trace+0x112/0x200 [] tree_mod_log_insert_key.constprop.45+0x93/0x150 [btrfs] [] __btrfs_cow_block+0x299/0x4f0 [btrfs] [] btrfs_cow_block+0x120/0x1f0 [btrfs] [] btrfs_search_slot+0x449/0x930 [btrfs] [] btrfs_lookup_inode+0x2f/0xa0 [btrfs] [] __btrfs_update_delayed_inode+0x1c/0x1d0 [btrfs] [] __btrfs_run_delayed_items+0x162/0x1e0 [btrfs] [] btrfs_delayed_inode_exit+0x3/0x20 [btrfs] [] btrfs_commit_transaction+0x203/0xa50 [btrfs] [] btrfs_sync_fs+0x69/0x110 [btrfs] [] __sync_filesystem+0x30/0x60 [] sync_filesystem+0x4b/0x70 [] generic_shutdown_super+0x3b/0xf0 [] kill_anon_super+0x16/0x30 unreferenced object 0xffff880677e0dd88 (size 32): comm "umount", pid 21508, jiffies 4295967793 (age 36718.112s) hex dump (first 32 bytes): 78 75 11 a9 06 88 ff ff 00 c0 e0 77 06 88 ff ff xu.........w.... 40 c3 a2 70 06 88 ff ff 00 00 00 00 00 00 00 00 @..p............ backtrace: [] kmemleak_alloc+0x26/0x50 [] kmem_cache_alloc_trace+0x112/0x200 [] btrfs_qgroup_record_ref+0xf/0x90 [btrfs] [] btrfs_add_delayed_tree_ref+0xf4/0x170 [btrfs] [] btrfs_free_tree_block+0x9a/0x220 [btrfs] [] __btrfs_cow_block+0x303/0x4f0 [btrfs] [] btrfs_cow_block+0x120/0x1f0 [btrfs] [] btrfs_search_slot+0x449/0x930 [btrfs] [] btrfs_lookup_inode+0x2f/0xa0 [btrfs] [] __btrfs_update_delayed_inode+0x1c/0x1d0 [btrfs] [] __btrfs_run_delayed_items+0x162/0x1e0 [btrfs] [] btrfs_delayed_inode_exit+0x3/0x20 [btrfs] [] btrfs_commit_transaction+0x203/0xa50 [btrfs] [] btrfs_sync_fs+0x69/0x110 [btrfs] [] __sync_filesystem+0x30/0x60 [] sync_filesystem+0x4b/0x70 Signed-off-by: Filipe David Borba Manana Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- Reading git-diff-tree failed