block: Change elevator_init_mq() to always succeed
authorDamien Le Moal <damien.lemoal@wdc.com>
Thu, 5 Sep 2019 09:51:30 +0000 (18:51 +0900)
committerJens Axboe <axboe@kernel.dk>
Fri, 6 Sep 2019 01:52:33 +0000 (19:52 -0600)
commit954b4a5ce4a806e7c284ce6b2659abdd03d0b6e2
treed750b8f375ef88ab4b75526c7e4128a62cc7c8ff
parent61db437d1cc16c470cf6fccc04d34be9cf6e4e4b
block: Change elevator_init_mq() to always succeed

If the default elevator chosen is mq-deadline, elevator_init_mq() may
return an error if mq-deadline initialization fails, leading to
blk_mq_init_allocated_queue() returning an error, which in turn will
cause the block device initialization to fail and the device not being
exposed.

Instead of taking such extreme measure, handle mq-deadline
initialization failures in the same manner as when mq-deadline is not
available (no module to load), that is, default to the "none" scheduler.
With this change, elevator_init_mq() return type can be changed to void.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c
block/blk.h
block/elevator.c