blk-mq-sched: fix crash in switch error path

In elevator_switch(), if blk_mq_init_sched() fails, we attempt to fall
back to the original scheduler. However, at this point, we've already
torn down the original scheduler's tags, so this causes a crash. Doing
the fallback like the legacy elevator path is much harder for mq, so fix
it by just falling back to none, instead.

Signed-off-by: Omar Sandoval <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
Omar Sandoval 2017-04-07 08:52:27 -06:00 • committed by Jens Axboe
commit 54d5329d42
6 changed files with 67 additions and 48 deletions

View file

@ -816,7 +816,7 @@ static void blk_release_queue(struct kobject *kobj)
if (q->elevator) {
ioc_clear_queue(q);
elevator_exit(q->elevator);
elevator_exit(q, q->elevator);
}
blk_exit_rl(&q->root_rl);