Skip to content

Commit

Permalink
elevator: printk a warning if switching to a new io scheduler fails
Browse files Browse the repository at this point in the history
printk a warning to indicate that the io scheduler has been set to none
if switching to a new io scheduler fails.

Suggested-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jinlong Chen <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Link: https://lore.kernel.org/r/d51ed0fb457db7a4f9cbb0dbce36d534e22be457.1669126766.git.nickyc975@zju.edu.cn
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
nickyc975 authored and axboe committed Nov 23, 2022
1 parent ac1171b commit e0cca8b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,12 @@ int elevator_switch(struct request_queue *q, struct elevator_type *new_e)
out_unfreeze:
blk_mq_unquiesce_queue(q);
blk_mq_unfreeze_queue(q);

if (ret) {
pr_warn("elv: switch to \"%s\" failed, falling back to \"none\"\n",
new_e->elevator_name);
}

return ret;
}

Expand Down

0 comments on commit e0cca8b

Please sign in to comment.