Mike Snitzer
4328daa2e7
dm: fix dm_rq_target_io leak on faults with .request_fn DM w/ blk-mq paths
Using request-based DM mpath configured with the following stacking
(.request_fn DM mpath ontop of scsi-mq paths):
echo Y > /sys/module/scsi_mod/parameters/use_blk_mq
echo N > /sys/module/dm_mod/parameters/use_blk_mq
'struct dm_rq_target_io' would leak if a request is requeued before a
blk-mq clone is allocated (or fails to allocate). free_rq_tio()
wasn't being called.
kmemleak reported:
unreferenced object 0xffff8800b90b98c0 (size 112):
comm "kworker/7:1H", pid 5692, jiffies 4295056109 (age 78.589s)
hex dump (first 32 bytes):
00 d0 5c 2c 03 88 ff ff 40 00 bf 01 00 c9 ff ff ..\,....@.......
e0 d9 b1 34 00 88 ff ff 00 00 00 00 00 00 00 00 ...4............
backtrace:
[<ffffffff81672b6e>] kmemleak_alloc+0x4e/0xb0
[<ffffffff811dbb63>] kmem_cache_alloc+0xc3/0x1e0
[<ffffffff8117eae5>] mempool_alloc_slab+0x15/0x20
[<ffffffff8117ec1e>] mempool_alloc+0x6e/0x170
[<ffffffffa00029ac>] dm_old_prep_fn+0x3c/0x180 [dm_mod]
[<ffffffff812fbd78>] blk_peek_request+0x168/0x290
[<ffffffffa0003e62>] dm_request_fn+0xb2/0x1b0 [dm_mod]
[<ffffffff812f66e3>] __blk_run_queue+0x33/0x40
[<ffffffff812f9585>] blk_delay_work+0x25/0x40
[<ffffffff81096fff>] process_one_work+0x14f/0x3d0
[<ffffffff81097715>] worker_thread+0x125/0x4b0
[<ffffffff8109ce88>] kthread+0xd8/0xf0
[<ffffffff8167cb8f>] ret_from_fork+0x3f/0x70
[<ffffffffffffffff>] 0xffffffffffffffff
crash> struct -o dm_rq_target_io
struct dm_rq_target_io {
...
}
SIZE: 112
Fixes: e5863d9ad7 ("dm: allocate requests in target when stacking on blk-mq devices")
Cc: stable@vger.kernel.org # 4.0+
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2016-02-21 20:27:50 -05:00
..
2016-02-06 00:34:01 +01:00
2016-02-10 11:35:55 -05:00
2016-02-14 10:40:21 -08:00
2016-01-17 12:32:01 -08:00
2016-02-11 08:56:09 -07:00
2016-01-06 16:37:14 +01:00
2016-02-01 12:27:18 -08:00
2016-01-06 08:25:24 -05:00
2016-02-17 09:39:56 +01:00
2016-02-18 19:10:22 -08:00
2016-01-31 15:49:06 -08:00
2016-01-04 21:46:45 -05:00
2016-01-29 21:45:17 +01:00
2016-01-29 21:45:17 +01:00
2016-02-06 15:23:56 +08:00
2016-01-13 17:30:33 +09:00
2016-02-15 22:19:32 +05:30
2016-01-01 18:31:34 +01:00
2016-02-16 12:48:18 +00:00
2016-02-10 11:00:49 +01:00
2016-02-19 13:36:05 +10:00
2016-01-20 17:30:20 -08:00
2016-01-07 16:07:54 +01:00
2016-01-13 10:23:36 -08:00
2016-01-27 18:48:46 -08:00
2016-02-03 08:28:43 -08:00
2016-01-29 11:13:52 +01:00
2016-01-18 14:12:33 -05:00
2016-02-01 13:08:26 -08:00
2016-02-12 14:56:08 -05:00
2016-02-10 12:21:57 -08:00
2016-02-16 08:04:06 -08:00
2016-02-11 10:20:02 +00:00
2016-01-11 23:55:43 -05:00
2016-01-17 12:32:01 -08:00
2016-01-12 12:17:28 +01:00
2016-02-04 09:19:45 -07:00
2016-02-02 16:47:14 +05:30
2016-02-21 20:27:50 -05:00
2016-02-04 16:26:10 -02:00
2016-01-20 18:42:30 -08:00
2016-01-20 17:09:18 -08:00
2016-02-09 14:18:23 -08:00
2016-02-06 22:12:56 -08:00
2016-02-11 16:49:35 +01:00
2016-01-24 12:50:56 -08:00
2016-02-13 17:35:23 -08:00
2016-01-21 19:53:10 -05:00
2016-01-29 17:43:16 -08:00
2016-02-12 08:10:31 -07:00
2016-02-07 23:09:13 -08:00
2016-02-17 11:50:53 -08:00
2016-01-22 18:04:28 -05:00
2016-01-20 17:09:18 -08:00
2016-01-03 16:32:59 -08:00
2016-02-12 15:31:22 -08:00
2016-02-10 11:46:01 +05:30
2016-02-15 20:45:50 +01:00
2016-01-30 09:40:35 -08:00
2016-02-03 01:00:29 +01:00
2016-01-14 01:03:18 +01:00
2016-01-12 01:12:40 +01:00
2016-01-29 12:38:59 -08:00
2016-01-21 15:04:59 +01:00
2016-01-20 17:09:18 -08:00
2016-01-15 12:14:47 -08:00
2016-01-12 20:47:06 +02:00
2016-01-12 20:47:06 +02:00
2016-01-18 12:10:45 -08:00
2016-02-17 09:24:07 +01:00
2016-01-04 10:26:58 -05:00
2016-02-18 16:24:48 -08:00
2016-01-22 17:30:52 -08:00
2016-02-12 23:04:41 +00:00
2016-01-19 21:25:57 +02:00
2016-02-06 22:13:16 -08:00
2016-02-10 23:08:55 -08:00
2016-02-11 07:13:29 -08:00
2016-02-07 18:22:54 -08:00
2016-02-04 17:00:10 -08:00
2016-01-27 11:22:25 -07:00
2016-01-29 14:20:16 +02:00
2016-01-26 10:18:28 +02:00
2016-01-31 16:54:36 +01:00
2016-01-29 15:13:48 -08:00