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
BugLink: https://bugs.launchpad.net/bugs/1815733

There's no reason to freeze queue and remove scheduler
if there's no scheduler already.

Signed-off-by: Aleksei Zakharov <zakharov.a.g@yandex.ru>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(backported from commit fbd7212)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Kleber Souza <kleber.souza@canonical.com>
Acked-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
  • Loading branch information
AlexZzz authored and smb49 committed May 15, 2019
1 parent c1e7e21 commit e78c326
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 @@ -1090,8 +1090,11 @@ static int __elevator_change(struct request_queue *q, const char *name)
/*
* Special case for mq, turn off scheduling
*/
if (q->mq_ops && !strncmp(name, "none", 4))
if (q->mq_ops && !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 e78c326

Please sign in to comment.