Skip to content

Commit 3aa7287

Browse files
author
Jens Axboe
committed
elevator: check for ELEVATOR_INSERT_SORT_MERGE in !elvpriv case too
The sort insert is the one that goes to the IO scheduler. With the SORT_MERGE addition, we could bypass IO scheduler setup but still ask the IO scheduler to insert the request. This would cause an oops on switching IO schedulers through the sysfs interface, unless the disk just happened to be idle while it occured. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
1 parent 584f790 commit 3aa7287

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

block/elevator.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,8 @@ void __elv_add_request(struct request_queue *q, struct request *rq, int where)
671671
q->boundary_rq = rq;
672672
}
673673
} else if (!(rq->cmd_flags & REQ_ELVPRIV) &&
674-
where == ELEVATOR_INSERT_SORT)
674+
(where == ELEVATOR_INSERT_SORT ||
675+
where == ELEVATOR_INSERT_SORT_MERGE))
675676
where = ELEVATOR_INSERT_BACK;
676677

677678
switch (where) {

0 commit comments

Comments
 (0)