diff options
author | Aleksei Zakharov <zakharov.a.g@yandex.ru> | 2019-02-11 11:50:37 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-02-11 16:21:40 +0100 |
commit | fbd72127c975dc8e532ecc73d52f3b1b00935bec (patch) | |
tree | 43817ee93cf8c5baca17958ec6d93c5e4fe7d1a6 /block/elevator.c | |
parent | block: avoid setting wbt_lat_usec to current value (diff) | |
download | linux-fbd72127c975dc8e532ecc73d52f3b1b00935bec.tar.xz linux-fbd72127c975dc8e532ecc73d52f3b1b00935bec.zip |
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>
Diffstat (limited to 'block/elevator.c')
-rw-r--r-- | block/elevator.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/block/elevator.c b/block/elevator.c index f05e90d4e695..d6d835a08de6 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -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); |