Ming Lei
bc8859174d
blk-mq: initialize mq kobjects in blk_mq_init_allocated_queue()
...
[ Upstream commit 737f98cfe7de8df7433a4d846850aa8efa44bd48 ]
Both q->mq_kobj and sw queues' kobjects should have been initialized
once, instead of doing that each add_disk context.
Also this patch removes clearing of ctx in blk_mq_init_cpu_queues()
because percpu allocator fills zero to allocated variable.
This patch fixes one issue[1] reported from Omar.
[1] kernel wearning when doing unbind/bind on one scsi-mq device
[ 19.347924] kobject (ffff8800791ea0b8): tried to init an initialized object, something is seriously wrong.
[ 19.349781] CPU: 1 PID: 84 Comm: kworker/u8:1 Not tainted 4.10.0-rc7-00210-g53f39eeaa263 #34
[ 19.350686] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-20161122_114906-anatol 04/01/2014
[ 19.350920] Workqueue: events_unbound async_run_entry_fn
[ 19.350920] Call Trace:
[ 19.350920] dump_stack+0x63/0x83
[ 19.350920] kobject_init+0x77/0x90
[ 19.350920] blk_mq_register_dev+0x40/0x130
[ 19.350920] blk_register_queue+0xb6/0x190
[ 19.350920] device_add_disk+0x1ec/0x4b0
[ 19.350920] sd_probe_async+0x10d/0x1c0 [sd_mod]
[ 19.350920] async_run_entry_fn+0x48/0x150
[ 19.350920] process_one_work+0x1d0/0x480
[ 19.350920] worker_thread+0x48/0x4e0
[ 19.350920] kthread+0x101/0x140
[ 19.350920] ? process_one_work+0x480/0x480
[ 19.350920] ? kthread_create_on_node+0x60/0x60
[ 19.350920] ret_from_fork+0x2c/0x40
Cc: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Tested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-14 09:28:21 +01:00
..
2017-10-08 10:26:06 +02:00
2016-10-21 15:45:47 -06:00
2016-08-07 14:41:02 -06:00
2017-10-18 09:35:41 +02:00
2016-09-30 10:31:20 +02:00
2017-11-30 08:39:06 +00:00
2016-07-20 21:28:22 -06:00
2016-10-26 07:49:27 -06:00
2017-05-20 14:28:36 +02:00
2015-11-06 17:50:42 -08:00
2016-10-11 15:06:30 -07:00
2016-12-07 08:23:35 -08:00
2016-08-24 08:17:24 -06:00
2016-09-15 08:42:03 -06:00
2017-08-24 17:12:20 -07:00
2017-12-14 09:28:21 +01:00
2016-10-09 17:29:33 -07:00
2016-10-09 17:29:33 -07:00
2017-12-14 09:28:21 +01:00
2017-12-14 09:28:21 +01:00
2016-04-13 13:33:19 -06:00
2016-10-15 10:03:15 -07:00
2016-09-21 07:56:16 -06:00
2015-01-23 14:15:46 -07:00
2016-09-19 15:12:41 -06:00
2017-11-30 08:39:06 +00:00
2016-09-15 08:42:03 -06:00
2015-09-19 18:57:09 -07:00
2017-10-21 17:21:33 +02:00
2017-01-09 08:32:25 +01:00
2017-06-14 15:05:58 +02:00
2014-01-21 20:18:26 -08:00
2016-04-04 10:41:08 -07:00
2016-07-20 21:35:12 -06:00
2016-08-16 09:16:51 -06:00
2016-08-04 14:19:16 -06:00
2016-10-11 15:06:30 -07:00
2016-07-01 08:39:24 -06:00
2016-10-09 17:29:33 -07:00
2012-03-06 21:27:21 +01:00
2016-10-09 17:32:20 -07:00
2015-11-16 15:21:48 -07:00
2017-05-14 14:00:22 +02:00
2017-03-22 12:43:38 +01:00
2015-10-21 14:42:38 -06:00