Commit 42eb94b1 authored by Jens Axboe's avatar Jens Axboe

[PATCH] front merge fix (really!)

Ok, this is the fixed and tested variant that also fixes the bug that
the previous trivial fix exposed.
parent 0a785252
...@@ -297,6 +297,9 @@ static void deadline_remove_request(request_queue_t *q, struct request *rq) ...@@ -297,6 +297,9 @@ static void deadline_remove_request(request_queue_t *q, struct request *rq)
deadline_del_drq_rb(dd, drq); deadline_del_drq_rb(dd, drq);
} }
if (q->last_merge == &rq->queuelist)
q->last_merge = NULL;
list_del_init(&rq->queuelist); list_del_init(&rq->queuelist);
} }
...@@ -424,12 +427,7 @@ deadline_move_to_dispatch(struct deadline_data *dd, struct deadline_rq *drq) ...@@ -424,12 +427,7 @@ deadline_move_to_dispatch(struct deadline_data *dd, struct deadline_rq *drq)
{ {
request_queue_t *q = drq->request->q; request_queue_t *q = drq->request->q;
if (q->last_merge == &drq->request->queuelist) deadline_remove_request(q, drq->request);
q->last_merge = NULL;
deadline_del_drq_hash(drq);
deadline_del_drq_rb(dd, drq);
list_del_init(&drq->fifo);
list_add_tail(&drq->request->queuelist, dd->dispatch); list_add_tail(&drq->request->queuelist, dd->dispatch);
} }
......
...@@ -399,7 +399,7 @@ struct request *elv_former_request(request_queue_t *q, struct request *rq) ...@@ -399,7 +399,7 @@ struct request *elv_former_request(request_queue_t *q, struct request *rq)
elevator_t *e = &q->elevator; elevator_t *e = &q->elevator;
if (e->elevator_former_req_fn) if (e->elevator_former_req_fn)
return e->elevator_latter_req_fn(q, rq); return e->elevator_former_req_fn(q, rq);
prev = rq->queuelist.prev; prev = rq->queuelist.prev;
if (prev != &q->queue_head && prev != &rq->queuelist) if (prev != &q->queue_head && prev != &rq->queuelist)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment