[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <OS0P286MB0338E8D41770BFDE7B3A4EBBBE229@OS0P286MB0338.JPNP286.PROD.OUTLOOK.COM>
Date: Wed, 12 Oct 2022 08:35:12 +0800
From: Jinlong Chen <chenjinlong2016@...look.com>
To: axboe@...nel.dk
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
Jinlong Chen <chenjinlong2016@...look.com>
Subject: [PATCH v2] blk-mq: put the reference of the io scheduler module after switching back
We got a reference of the io scheduler module in
blk_mq_elv_switch_none to prevent the module from
being removed. We need to put that reference back
once we are done.
Signed-off-by: Jinlong Chen <chenjinlong2016@...look.com>
---
---
Changes in v2:
- reword the commit message because the patch is for blk-mq precisely
block/blk-mq.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 8070b6c10e8d..8dfe3bf3e599 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -4595,6 +4595,13 @@ static void blk_mq_elv_switch_back(struct list_head *head,
mutex_lock(&q->sysfs_lock);
elevator_switch(q, t);
+ /**
+ * We got a reference of the io scheduler module in
+ * blk_mq_elv_switch_none to prevent the module from
+ * being removed. We need to put that reference back
+ * once we are done.
+ */
+ module_put(t->elevator_owner);
mutex_unlock(&q->sysfs_lock);
}
--
2.34.1
Powered by blists - more mailing lists