Skip to content

Commit

Permalink
block: avoid setting none scheduler if it's already none
Browse files Browse the repository at this point in the history
There's no reason to freeze queue and remove scheduler
if there's no scheduler already.

Signed-off-by: Aleksei Zakharov <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
AlexZzz authored and axboe committed Feb 11, 2019
1 parent b7143fe commit fbd7212
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,11 @@ static int __elevator_change(struct request_queue *q, const char *name)
/*
* Special case for mq, turn off scheduling
*/
if (!strncmp(name, "none", 4))
if (!strncmp(name, "none", 4)) {
if (!q->elevator)
return 0;
return elevator_switch(q, NULL);
}

strlcpy(elevator_name, name, sizeof(elevator_name));
e = elevator_get(q, strstrip(elevator_name), true);
Expand Down

0 comments on commit fbd7212

Please sign in to comment.