Linux-Block Archive on lore.kernel.org
 help / 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	[flat|nested] 2+ messages in thread

* Re: [PATCH] block: avoid setting none scheduler if it's already none
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2019-02-11 15:21 UTC (permalink / raw)
  To: Aleksei Zakharov; +Cc: linux-block

On 2/11/19 3:50 AM, Aleksei Zakharov wrote:
> There's no reason to freeze queue and remove scheduler
> if there's no scheduler already.

Applied, thanks.

-- 
Jens Axboe


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

end of thread, back to index

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

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org linux-block@archiver.kernel.org
	public-inbox-index linux-block


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/ public-inbox