Commit 673514af authored by Stefan Haberland's avatar Stefan Haberland Committed by Martin Schwidefsky

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: default avatarStefan Haberland <sth@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent fc3100d6
...@@ -1644,7 +1644,9 @@ void dasd_generic_handle_state_change(struct dasd_device *device) ...@@ -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) ...@@ -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) ...@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment