Skip to content

Commit fbd7212

Browse files
AlexZzzaxboe
authored andcommitted
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: Aleksei Zakharov <zakharov.a.g@yandex.ru> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent b7143fe commit fbd7212

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎block/elevator.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,11 @@ static int __elevator_change(struct request_queue *q, const char *name)
667667
/*
668668
* Special case for mq, turn off scheduling
669669
*/
670-
if (!strncmp(name, "none", 4))
670+
if (!strncmp(name, "none", 4)) {
671+
if (!q->elevator)
672+
return 0;
671673
return elevator_switch(q, NULL);
674+
}
672675

673676
strlcpy(elevator_name, name, sizeof(elevator_name));
674677
e = elevator_get(q, strstrip(elevator_name), true);

0 commit comments

Comments
 (0)