Merge tag 'nfs-for-3.3-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
[firefly-linux-kernel-4.4.55.git] / block / elevator.c
index cca049fb45c8f4c3f5ea56c9ab7d291995ed33ec..91e18f8af9becaace380cc687d279eb1f47cb79a 100644 (file)
@@ -979,8 +979,9 @@ static int elevator_switch(struct request_queue *q, struct elevator_type *new_e)
                        goto fail_register;
        }
 
-       /* done, replace the old one with new one and turn off BYPASS */
+       /* done, clear io_cq's, switch elevators and turn off BYPASS */
        spin_lock_irq(q->queue_lock);
+       ioc_clear_queue(q);
        old_elevator = q->elevator;
        q->elevator = e;
        spin_unlock_irq(q->queue_lock);