linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: avoid setting none scheduler if it's already none
@ 2019-02-11 10:50 Aleksei Zakharov
  2019-02-11 15:21 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Aleksei Zakharov @ 2019-02-11 10:50 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, Aleksei Zakharov

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>
---
 block/elevator.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/block/elevator.c b/block/elevator.c
index f05e90d..d6d835a 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);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-11 15:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-11 10:50 [PATCH] block: avoid setting none scheduler if it's already none Aleksei Zakharov
2019-02-11 15:21 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).