]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - block/elevator.c
elevator: fix loading wrong elevator type for blk-mq devices
[mirror_ubuntu-artful-kernel.git] / block / elevator.c
index ef7f59469acc7f313d3444545c9c5835efe81cc7..b2a55167f0c214f48d9c99b0e601461ab24f5518 100644 (file)
@@ -207,11 +207,12 @@ int elevator_init(struct request_queue *q, char *name)
        }
 
        /*
-        * Use the default elevator specified by config boot param or
-        * config option.  Don't try to load modules as we could be running
-        * off async and request_module() isn't allowed from async.
+        * Use the default elevator specified by config boot param for
+        * non-mq devices, or by config option. Don't try to load modules
+        * as we could be running off async and request_module() isn't
+        * allowed from async.
         */
-       if (!e && *chosen_elevator) {
+       if (!e && !q->mq_ops && *chosen_elevator) {
                e = elevator_get(chosen_elevator, false);
                if (!e)
                        printk(KERN_ERR "I/O scheduler %s not found\n",