There's no reason to freeze queue and remove scheduler if there's no scheduler already.
Unified · Split
| @@ -667,8 +667,11 @@ static int __elevator_change(struct request_queue *q, const char *name) · 666 unmodified lines | ||
| 667 | 667 | /* |
| 668 | 668 | * Special case for mq, turn off scheduling |
| 669 | 669 | */ |
| 670 | − if (!strncmp(name, "none", 4)) | |
| 670 | + if (!strncmp(name, "none", 4)) { | |
| 671 | + if (!q->elevator) | |
| 672 | + return 0; | |
| 671 | 673 | return elevator_switch(q, NULL); |
| 674 | + } | |
| 672 | 675 | |
| 673 | 676 | strlcpy(elevator_name, name, sizeof(elevator_name)); |
| 674 | 677 | e = elevator_get(q, strstrip(elevator_name), true); |