Kinglong Mee
aa66b0bb08
btrfs: fix memory leak of fs_info in block group cache
When starting up linux with btrfs filesystem, I got many memory leak
messages by kmemleak as,
unreferenced object 0xffff880066882000 (size 4096):
comm "modprobe", pid 730, jiffies 4294690024 (age 196.599s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff8174d52e>] kmemleak_alloc+0x4e/0xb0
[<ffffffff811d09aa>] kmem_cache_alloc_trace+0xea/0x1e0
[<ffffffffa03620fb>] btrfs_alloc_dummy_fs_info+0x6b/0x2a0 [btrfs]
[<ffffffffa03624fc>] btrfs_alloc_dummy_block_group+0x5c/0x120 [btrfs]
[<ffffffffa0360aa9>] btrfs_test_free_space_cache+0x39/0xed0 [btrfs]
[<ffffffffa03b5a74>] trace_raw_output_xfs_attr_class+0x54/0xe0 [xfs]
[<ffffffff81002122>] do_one_initcall+0xb2/0x1f0
[<ffffffff811765aa>] do_init_module+0x5e/0x1e9
[<ffffffff810fec09>] load_module+0x20a9/0x2690
[<ffffffff810ff439>] SyS_finit_module+0xb9/0xf0
[<ffffffff81757daf>] entry_SYSCALL_64_fastpath+0x12/0x76
[<ffffffffffffffff>] 0xffffffffffffffff
unreferenced object 0xffff8800573f8000 (size 10256):
comm "modprobe", pid 730, jiffies 4294690185 (age 196.460s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff8174d52e>] kmemleak_alloc+0x4e/0xb0
[<ffffffff8119ca6e>] kmalloc_order+0x5e/0x70
[<ffffffff8119caa4>] kmalloc_order_trace+0x24/0x90
[<ffffffffa03620b3>] btrfs_alloc_dummy_fs_info+0x23/0x2a0 [btrfs]
[<ffffffffa03624fc>] btrfs_alloc_dummy_block_group+0x5c/0x120 [btrfs]
[<ffffffffa036603d>] run_test+0xfd/0x320 [btrfs]
[<ffffffffa0366f34>] btrfs_test_free_space_tree+0x94/0xee [btrfs]
[<ffffffffa03b5aab>] trace_raw_output_xfs_attr_class+0x8b/0xe0 [xfs]
[<ffffffff81002122>] do_one_initcall+0xb2/0x1f0
[<ffffffff811765aa>] do_init_module+0x5e/0x1e9
[<ffffffff810fec09>] load_module+0x20a9/0x2690
[<ffffffff810ff439>] SyS_finit_module+0xb9/0xf0
[<ffffffff81757daf>] entry_SYSCALL_64_fastpath+0x12/0x76
[<ffffffffffffffff>] 0xffffffffffffffff
This patch lets btrfs using fs_info stored in btrfs_root for
block group cache directly without allocating a new one.
Fixes: d0bd456074
("Btrfs: add fragment=* debug mount option")
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-02-18 13:28:24 +01:00
..
2016-02-18 13:28:24 +01:00
2016-01-18 12:44:40 -08:00
2016-01-25 16:50:26 -08:00
2015-08-31 11:46:40 -07:00
2016-01-15 19:27:18 +01:00
2015-01-14 19:23:47 +01:00
2016-01-07 14:26:58 +01:00
2016-01-07 14:38:42 +01:00
2013-11-24 16:33:41 -07:00
2015-11-07 14:32:45 -08:00
2015-02-16 18:48:44 +01:00
2016-01-11 06:08:37 -08:00
2016-01-22 11:49:21 -08:00
2016-01-07 14:30:17 +01:00
2014-01-28 13:20:09 -08:00
2016-01-07 14:26:58 +01:00
2016-01-07 14:26:58 +01:00
2016-01-15 19:22:28 +01:00
2012-12-12 17:15:41 -05:00
2014-11-20 17:20:07 -08:00
2016-01-29 15:46:49 -08:00
2016-01-11 06:08:37 -08:00
2015-10-06 06:55:23 -07:00
2016-01-11 06:08:37 -08:00
2015-12-23 13:29:09 -08:00
2016-01-15 19:22:28 +01:00
2016-01-15 19:22:28 +01:00
2016-01-20 07:22:14 -08:00
2016-01-07 15:01:15 +01:00
2016-02-18 13:18:06 +01:00
2016-01-11 06:08:37 -08:00
2016-01-07 15:01:14 +01:00
2016-01-29 08:19:37 -08:00
2015-12-17 12:16:47 -08:00
2014-10-14 10:51:22 +02:00
2014-01-28 13:20:31 -08:00
2015-09-29 16:30:00 +02:00
2016-01-19 18:21:30 -08:00
2016-01-15 19:25:02 +01:00
2016-01-29 15:46:49 -08:00
2016-01-29 08:19:37 -08:00
2015-01-06 11:04:29 -08:00
2016-01-07 14:30:52 +01:00
2014-11-19 10:34:35 -08:00
2015-02-16 18:48:44 +01:00
2015-12-17 12:16:47 -08:00
2015-03-03 17:23:57 +01:00
2015-10-21 18:51:40 -07:00
2015-10-21 18:51:40 -07:00
2014-09-17 13:37:12 -07:00
2014-10-02 17:14:50 +02:00
2013-05-06 15:55:23 -04:00
2015-10-21 18:28:48 +02:00
2014-01-28 13:20:24 -08:00
2015-11-25 05:27:33 -08:00
2015-10-21 18:41:10 -07:00
2016-01-20 07:22:18 -08:00
2015-08-09 07:34:26 -07:00
2012-06-14 21:29:16 -04:00
2015-10-21 18:29:50 +02:00
2016-01-29 15:46:49 -08:00
2015-10-21 18:21:40 -07:00
2016-01-22 18:04:28 -05:00
2015-12-31 18:08:20 +00:00
2016-01-07 14:38:02 +01:00
2012-07-23 16:28:06 -04:00
2016-01-29 08:19:37 -08:00
2016-01-27 05:40:10 -08:00
2016-01-21 18:50:40 +01:00
2016-01-11 06:08:37 -08:00
2016-01-07 15:20:55 +01:00
2015-12-18 02:51:32 +00:00
2016-01-25 16:50:26 -08:00
2015-03-26 17:56:23 -07:00
2015-06-10 09:26:17 -07:00
2015-06-10 09:26:17 -07:00
2014-09-17 13:38:02 -07:00
2016-01-29 08:19:37 -08:00
2016-01-11 06:08:37 -08:00
2016-01-22 18:04:28 -05:00
2015-12-06 21:34:14 -05:00
2015-02-16 18:48:44 +01:00