diff options
-rw-r--r-- | drivers/block/elevator.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c index 36f1057084b0..d4a49a3df829 100644 --- a/drivers/block/elevator.c +++ b/drivers/block/elevator.c | |||
@@ -369,9 +369,14 @@ void __elv_add_request(request_queue_t *q, struct request *rq, int where, | |||
369 | case ELEVATOR_INSERT_SORT: | 369 | case ELEVATOR_INSERT_SORT: |
370 | BUG_ON(!blk_fs_request(rq)); | 370 | BUG_ON(!blk_fs_request(rq)); |
371 | rq->flags |= REQ_SORTED; | 371 | rq->flags |= REQ_SORTED; |
372 | q->elevator->ops->elevator_add_req_fn(q, rq); | ||
373 | if (q->last_merge == NULL && rq_mergeable(rq)) | 372 | if (q->last_merge == NULL && rq_mergeable(rq)) |
374 | q->last_merge = rq; | 373 | q->last_merge = rq; |
374 | /* | ||
375 | * Some ioscheds (cfq) run q->request_fn directly, so | ||
376 | * rq cannot be accessed after calling | ||
377 | * elevator_add_req_fn. | ||
378 | */ | ||
379 | q->elevator->ops->elevator_add_req_fn(q, rq); | ||
375 | break; | 380 | break; |
376 | 381 | ||
377 | default: | 382 | default: |