Commit dd50541f authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] cfq-iosched: bad accounting on non-fs requests

Current cfq can cause hangs with non-fs requests, because the accounting
goes bad.  This fixes it.
Signed-off-by: default avatarJens Axboe <axboe@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6de519e4
......@@ -867,6 +867,9 @@ static inline void cfq_account_dispatch(struct cfq_rq *crq)
struct cfq_data *cfqd = cfqq->cfqd;
unsigned long now, elapsed;
if (!blk_fs_request(crq->request))
return;
/*
* accounted bit is necessary since some drivers will call
* elv_next_request() many times for the same request (eg ide)
......@@ -912,6 +915,9 @@ cfq_account_completion(struct cfq_queue *cfqq, struct cfq_rq *crq)
{
struct cfq_data *cfqd = cfqq->cfqd;
if (!crq->accounted)
return;
WARN_ON(!cfqd->rq_in_driver);
cfqd->rq_in_driver--;
......
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