Blob Blame History Raw
From ac1171bd2c7a3a32dfbdd3c347919fee32b745a1 Mon Sep 17 00:00:00 2001
From: Jinlong Chen <nickyc975@zju.edu.cn>
Date: Tue, 22 Nov 2022 22:21:23 +0800
Subject: [PATCH] elevator: update the document of elevator_switch
Git-commit: ac1171bd2c7a3a32dfbdd3c347919fee32b745a1
Patch-mainline: v6.2-rc1
References: git-fixes

We no longer support falling back to the old io scheduler if switching to
the new one fails. Update the document to indicate that.

(Coly Li: refreshed for Linux v5.14 based SUSE kernel)

Fixes: a1ce35fa4985 ("block: remove dead elevator code")
Signed-off-by: Jinlong Chen <nickyc975@zju.edu.cn>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/94250961689ba7d2e67a7d9e7995a11166fedb31.1669126766.git.nickyc975@zju.edu.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Coly Li <colyli@suse.de>

---
 block/elevator.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/block/elevator.c
+++ b/block/elevator.c
@@ -706,10 +706,10 @@ void elevator_init_mq(struct request_que
 EXPORT_SYMBOL_GPL(elevator_init_mq); /* only for dm-rq */
 
 /*
- * switch to new_e io scheduler. be careful not to introduce deadlocks -
- * we don't free the old io scheduler, before we have allocated what we
- * need for the new one. this way we have a chance of going back to the old
- * one, if the new one fails init for some reason.
+ * Switch to new_e io scheduler.
+ *
+ * If switching fails, we are most likely running out of memory and not able
+ * to restore the old io scheduler, so leaving the io scheduler being none.
  */
 static int elevator_switch(struct request_queue *q, struct elevator_type *new_e)
 {