* [PATCH] block: return NULL if request_module() failed in elevator_get()
@ 2019-01-04 14:25 Chengguang Xu
0 siblings, 0 replies; only message in thread
From: Chengguang Xu @ 2019-01-04 14:25 UTC (permalink / raw)
To: axboe; +Cc: linux-block, Chengguang Xu
If request_module() failed then it seems no reason to lookup
the iosched again, so add a check to handle this case.
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
block/elevator.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/elevator.c b/block/elevator.c
index 8fdcd64ae12e..f89527951243 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -124,7 +124,9 @@ static struct elevator_type *elevator_get(struct request_queue *q,
e = elevator_find(name, q->mq_ops != NULL);
if (!e && try_loading) {
spin_unlock(&elv_list_lock);
- request_module("%s-iosched", name);
+ if (request_module("%s-iosched", name))
+ return e;
+
spin_lock(&elv_list_lock);
e = elevator_find(name, q->mq_ops != NULL);
}
--
2.17.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-01-04 14:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-04 14:25 [PATCH] block: return NULL if request_module() failed in elevator_get() Chengguang Xu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.