Commit fbd72127 authored by Aleksei Zakharov's avatar Aleksei Zakharov Committed by Jens Axboe

block: avoid setting none scheduler if it's already none

There's no reason to freeze queue and remove scheduler
if there's no scheduler already.
Signed-off-by: default avatarAleksei Zakharov <zakharov.a.g@yandex.ru>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b7143fe6
...@@ -667,8 +667,11 @@ static int __elevator_change(struct request_queue *q, const char *name) ...@@ -667,8 +667,11 @@ static int __elevator_change(struct request_queue *q, const char *name)
/* /*
* Special case for mq, turn off scheduling * 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); return elevator_switch(q, NULL);
}
strlcpy(elevator_name, name, sizeof(elevator_name)); strlcpy(elevator_name, name, sizeof(elevator_name));
e = elevator_get(q, strstrip(elevator_name), true); e = elevator_get(q, strstrip(elevator_name), true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment