Zdenek Kabelac
89a459e0d5
md: free unused memory after bitmap resize
[ Upstream commit 0868b99c21 ]
When bitmap is resized, the old kalloced chunks just are not released
once the resized bitmap starts to use new space.
This fixes in particular kmemleak reports like this one:
unreferenced object 0xffff8f4311e9c000 (size 4096):
comm "lvm", pid 19333, jiffies 4295263268 (age 528.265s)
hex dump (first 32 bytes):
02 80 02 80 02 80 02 80 02 80 02 80 02 80 02 80 ................
02 80 02 80 02 80 02 80 02 80 02 80 02 80 02 80 ................
backtrace:
[<ffffffffa69471ca>] kmemleak_alloc+0x4a/0xa0
[<ffffffffa628c10e>] kmem_cache_alloc_trace+0x14e/0x2e0
[<ffffffffa676cfec>] bitmap_checkpage+0x7c/0x110
[<ffffffffa676d0c5>] bitmap_get_counter+0x45/0xd0
[<ffffffffa676d6b3>] bitmap_set_memory_bits+0x43/0xe0
[<ffffffffa676e41c>] bitmap_init_from_disk+0x23c/0x530
[<ffffffffa676f1ae>] bitmap_load+0xbe/0x160
[<ffffffffc04c47d3>] raid_preresume+0x203/0x2f0 [dm_raid]
[<ffffffffa677762f>] dm_table_resume_targets+0x4f/0xe0
[<ffffffffa6774b52>] dm_resume+0x122/0x140
[<ffffffffa6779b9f>] dev_suspend+0x18f/0x290
[<ffffffffa677a3a7>] ctl_ioctl+0x287/0x560
[<ffffffffa677a693>] dm_ctl_ioctl+0x13/0x20
[<ffffffffa62d6b46>] do_vfs_ioctl+0xa6/0x750
[<ffffffffa62d7269>] SyS_ioctl+0x79/0x90
[<ffffffffa6956d41>] entry_SYSCALL_64_fastpath+0x1f/0xc2
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-17 15:08:00 +01:00
..
2017-12-05 11:26:34 +01:00
2017-11-02 11:10:55 +01:00
2017-12-17 15:08:00 +01:00
2017-11-02 11:10:55 +01:00
2017-06-19 11:03:50 -04:00
2017-06-09 09:27:32 -06:00
2017-06-19 11:03:50 -04:00
2017-03-07 11:30:16 -05:00
2017-08-23 12:49:55 -06:00
2017-11-30 08:40:42 +00:00
2017-08-28 11:47:17 -04:00
2017-11-02 11:10:55 +01:00
2017-05-17 09:44:53 -04:00
2017-03-07 13:28:31 -05:00
2016-12-16 00:13:41 +02:00
2017-05-05 14:40:13 -04:00
2017-03-07 13:28:31 -05:00
2017-03-07 13:28:31 -05:00
2017-05-14 21:54:33 -04:00
2017-03-07 13:28:31 -05:00
2017-11-30 08:40:42 +00:00
2017-11-30 08:40:43 +00:00
2017-11-30 08:40:42 +00:00
2017-08-23 12:49:55 -06:00
2017-08-23 12:49:55 -06:00
2015-11-04 21:19:53 -08:00
2016-01-08 20:03:05 -05:00
2017-09-14 13:43:16 -07:00
2017-11-30 08:40:42 +00:00
2017-08-23 12:49:55 -06:00
2017-09-25 11:18:29 -04:00
2017-06-19 11:03:51 -04:00
2017-09-14 13:43:16 -07:00
2015-10-31 19:06:00 -04:00
2015-04-15 12:10:20 -04:00
2017-09-14 13:43:16 -07:00
2016-11-01 09:43:26 -06:00
2017-11-30 08:40:42 +00:00
2016-02-22 22:34:42 -05:00
2016-02-22 22:34:42 -05:00
2017-08-23 12:49:55 -06:00
2017-12-17 15:08:00 +01:00
2016-08-07 14:41:02 -06:00
2017-02-17 00:54:09 -05:00
2017-08-28 10:23:28 -04:00
2017-08-28 10:23:28 -04:00
2016-02-22 22:34:42 -05:00
2017-05-31 10:50:23 -04:00
2016-01-08 20:03:05 -05:00
2017-08-23 12:49:55 -06:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-14 13:43:16 -07:00
2017-09-14 13:43:16 -07:00
2016-06-10 15:15:44 -04:00
2017-11-30 08:40:43 +00:00
2017-06-09 09:27:32 -06:00
2017-05-15 15:09:49 -04:00
2016-07-20 12:43:35 -04:00
2017-09-14 13:43:16 -07:00
2017-07-26 15:55:44 -04:00
2017-03-16 09:37:31 -04:00
2017-09-14 13:43:16 -07:00
2017-04-24 15:37:04 -04:00
2017-06-09 09:27:32 -06:00
2017-08-23 12:49:55 -06:00
2017-07-26 15:55:43 -04:00
2017-11-30 08:40:42 +00:00
2017-06-19 11:05:20 -04:00
2017-11-30 08:40:43 +00:00
2017-04-27 17:08:44 -04:00
2017-08-23 12:49:55 -06:00
2017-06-19 11:05:20 -04:00
2017-08-23 12:49:55 -06:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-05-21 20:37:09 -07:00
2017-11-02 11:10:55 +01:00
2017-12-05 11:26:38 +01:00
2017-09-27 20:07:40 -07:00
2017-08-23 12:49:55 -06:00
2017-11-02 11:10:55 +01:00
2017-09-07 12:41:48 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-30 08:40:52 +00:00
2017-11-02 11:10:55 +01:00
2017-12-14 09:52:59 +01:00
2017-11-02 11:10:55 +01:00
2017-09-07 12:41:48 -07:00
2017-12-05 11:26:38 +01:00
2017-11-02 11:10:55 +01:00
2017-09-07 12:41:48 -07:00
2017-11-02 11:10:55 +01:00