Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -1
+2 -1
block/elevator.c
··· 671 671 q->boundary_rq = rq; 672 672 } 673 673 } else if (!(rq->cmd_flags & REQ_ELVPRIV) && 674 - where == ELEVATOR_INSERT_SORT) 674 + (where == ELEVATOR_INSERT_SORT || 675 + where == ELEVATOR_INSERT_SORT_MERGE)) 675 676 where = ELEVATOR_INSERT_BACK; 676 677 677 678 switch (where) {