Skip to content

Commit

Permalink
s390/dasd: fix race during dasd initialization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefan Haberland authored and Martin Schwidefsky committed Sep 13, 2017
1 parent fc3100d commit 673514a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/s390/block/dasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,9 @@ void dasd_generic_handle_state_change(struct dasd_device *device)
dasd_schedule_device_bh(device);
if (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);
Expand Down Expand Up @@ -3759,7 +3761,9 @@ int dasd_generic_path_operational(struct dasd_device *device)
dasd_schedule_device_bh(device);
if (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)
Expand Down Expand Up @@ -4025,7 +4029,9 @@ int dasd_generic_restore_device(struct ccw_device *cdev)

if (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);
Expand Down

0 comments on commit 673514a

Please sign in to comment.