linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aleksei Zakharov <zakharov.a.g@yandex.ru>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org, Aleksei Zakharov <zakharov.a.g@yandex.ru>
Subject: [PATCH] block: avoid setting none scheduler if it's already none
Date: Mon, 11 Feb 2019 13:50:37 +0300	[thread overview]
Message-ID: <1549882237-28183-1-git-send-email-zakharov.a.g@yandex.ru> (raw)

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


             reply	other threads:[~2019-02-11 10:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11 10:50 Aleksei Zakharov [this message]
2019-02-11 15:21 ` [PATCH] block: avoid setting none scheduler if it's already none Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1549882237-28183-1-git-send-email-zakharov.a.g@yandex.ru \
    --to=zakharov.a.g@yandex.ru \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).