Mike Snitzer
5c6f666742
dm: fix dm_rq_target_io leak on faults with .request_fn DM w/ blk-mq paths
commit 4328daa2e7 upstream.
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")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03 15:07:14 -08:00
..
2016-03-03 15:07:09 -08:00
2016-03-03 15:07:14 -08:00
2015-10-12 01:32:05 -05:00
2015-10-12 01:32:05 -05:00
2015-07-29 08:55:15 -06:00
2015-05-29 14:19:06 -04:00
2013-11-23 22:33:55 -08:00
2015-10-31 19:06:01 -04:00
2014-01-14 23:23:03 -05:00
2014-01-14 23:23:04 -05:00
2014-11-10 15:25:30 -05:00
2015-11-04 21:19:53 -08:00
2015-06-11 17:13:00 -04:00
2015-11-04 21:19:53 -08:00
2015-06-11 17:13:01 -04:00
2015-10-31 19:06:01 -04:00
2015-10-31 19:06:01 -04:00
2014-01-16 13:44:11 -05:00
2015-06-11 17:13:01 -04:00
2015-10-31 19:06:00 -04:00
2015-11-19 13:38:30 -05:00
2015-10-31 19:06:05 -04:00
2015-10-31 19:06:02 -04:00
2015-11-04 21:19:53 -08:00
2016-03-03 15:07:14 -08:00
2015-10-31 19:05:59 -04:00
2015-10-31 19:06:00 -04:00
2015-08-05 10:35:49 -07:00
2015-11-06 17:50:42 -08:00
2015-10-31 19:06:03 -04:00
2015-10-31 19:06:00 -04:00
2015-04-15 12:10:20 -04:00
2015-10-31 19:05:59 -04:00
2015-11-17 14:19:00 -05:00
2015-09-02 16:35:26 -07:00
2015-10-02 12:02:31 -04:00
2015-10-31 19:06:01 -04:00
2016-03-03 15:07:14 -08:00
2016-03-03 15:07:14 -08:00
2016-03-03 15:07:14 -08:00
2015-08-18 17:20:03 -04:00
2015-06-17 12:40:40 -04:00
2015-09-02 16:35:26 -07:00
2015-10-31 19:06:06 -04:00
2015-04-15 12:10:17 -04:00
2015-10-21 14:42:42 -06:00
2015-02-09 13:06:47 -05:00
2015-12-09 13:18:12 -05:00
2015-06-11 17:13:04 -04:00
2016-03-03 15:07:10 -08:00
2015-10-31 19:05:59 -04:00
2015-07-29 08:55:15 -06:00
2016-03-03 15:07:14 -08:00
2015-08-13 12:31:57 -06:00
2015-07-29 08:55:15 -06:00
2015-11-09 09:09:52 +11:00
2015-08-13 12:31:57 -06:00
2015-10-24 17:16:19 +11:00
2015-10-24 17:16:18 +11:00
2015-10-12 03:35:30 -05:00
2016-02-17 12:30:57 -08:00
2016-02-17 12:30:57 -08:00
2016-02-17 12:30:57 -08:00
2015-10-02 17:23:44 +10:00
2015-08-13 12:31:57 -06:00
2016-02-17 12:30:57 -08:00
2015-10-12 01:32:05 -05:00
2015-11-01 13:48:29 +11:00
2015-11-04 21:12:47 -08:00
2015-11-01 13:48:29 +11:00
2016-02-17 12:30:57 -08:00
2015-08-31 19:43:45 +02:00