Commit 0b642bb2 authored by Andrew Morton's avatar Andrew Morton Committed by David Mosberger

[PATCH] DEADLINE: hash removal fix

From Jens: It fixes the occasional

	BUG_ON(list_empty(&req->queuelist));

which people have been hitting in include/linux/blkdev.h:
blkdev_dequeue_request()
parent 07b71f8c
...@@ -121,6 +121,15 @@ static inline void deadline_del_drq_hash(struct deadline_rq *drq) ...@@ -121,6 +121,15 @@ static inline void deadline_del_drq_hash(struct deadline_rq *drq)
__deadline_del_drq_hash(drq); __deadline_del_drq_hash(drq);
} }
static void
deadline_remove_merge_hints(request_queue_t *q, struct deadline_rq *drq)
{
deadline_del_drq_hash(drq);
if (q->last_merge == &drq->request->queuelist)
q->last_merge = NULL;
}
static inline void static inline void
deadline_add_drq_hash(struct deadline_data *dd, struct deadline_rq *drq) deadline_add_drq_hash(struct deadline_data *dd, struct deadline_rq *drq)
{ {
...@@ -310,7 +319,7 @@ static void deadline_remove_request(request_queue_t *q, struct request *rq) ...@@ -310,7 +319,7 @@ static void deadline_remove_request(request_queue_t *q, struct request *rq)
struct deadline_data *dd = q->elevator.elevator_data; struct deadline_data *dd = q->elevator.elevator_data;
list_del_init(&drq->fifo); list_del_init(&drq->fifo);
deadline_del_drq_hash(drq); deadline_remove_merge_hints(q, drq);
deadline_del_drq_rb(dd, drq); deadline_del_drq_rb(dd, drq);
} }
} }
......
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