s390/dasd: fix race during dasd initialization

Fix a panic in blk_mq_hctx_has_pending() that is caused by a racy call to
blk_mq_run_hw_queues in a dasd function that might get called with the
request queue not yet initialized during initialization.

Signed-off-by: Stefan Haberland <sth@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Stefan Haberland 2017-09-12 17:22:42 +02:00 коммит произвёл Martin Schwidefsky
Родитель fc3100d64f
Коммит 673514aff5
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -1644,7 +1644,9 @@ void dasd_generic_handle_state_change(struct dasd_device *device)
dasd_schedule_device_bh(device); dasd_schedule_device_bh(device);
if (device->block) { if (device->block) {
dasd_schedule_block_bh(device->block); dasd_schedule_block_bh(device->block);
blk_mq_run_hw_queues(device->block->request_queue, true); if (device->block->request_queue)
blk_mq_run_hw_queues(device->block->request_queue,
true);
} }
} }
EXPORT_SYMBOL_GPL(dasd_generic_handle_state_change); EXPORT_SYMBOL_GPL(dasd_generic_handle_state_change);
@ -3759,7 +3761,9 @@ int dasd_generic_path_operational(struct dasd_device *device)
dasd_schedule_device_bh(device); dasd_schedule_device_bh(device);
if (device->block) { if (device->block) {
dasd_schedule_block_bh(device->block); dasd_schedule_block_bh(device->block);
blk_mq_run_hw_queues(device->block->request_queue, true); if (device->block->request_queue)
blk_mq_run_hw_queues(device->block->request_queue,
true);
} }
if (!device->stopped) if (!device->stopped)
@ -4025,7 +4029,9 @@ int dasd_generic_restore_device(struct ccw_device *cdev)
if (device->block) { if (device->block) {
dasd_schedule_block_bh(device->block); dasd_schedule_block_bh(device->block);
blk_mq_run_hw_queues(device->block->request_queue, true); if (device->block->request_queue)
blk_mq_run_hw_queues(device->block->request_queue,
true);
} }
clear_bit(DASD_FLAG_SUSPENDED, &device->flags); clear_bit(DASD_FLAG_SUSPENDED, &device->flags);