Skip to content

Commit

Permalink
elevator: check for ELEVATOR_INSERT_SORT_MERGE in !elvpriv case too
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe committed Apr 21, 2011
1 parent 584f790 commit 3aa7287
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,8 @@ void __elv_add_request(struct request_queue *q, struct request *rq, int where)
q->boundary_rq = rq;
}
} else if (!(rq->cmd_flags & REQ_ELVPRIV) &&
where == ELEVATOR_INSERT_SORT)
(where == ELEVATOR_INSERT_SORT ||
where == ELEVATOR_INSERT_SORT_MERGE))
where = ELEVATOR_INSERT_BACK;

switch (where) {
Expand Down

0 comments on commit 3aa7287

Please sign in to comment.