Commit 2df99e60 authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] cfq-iosched: in_driver accounting bug

Yet another accounting bug, this time hits on requeue. It is possible
for ->accounted to be set with ->in_flight, so don't nest the
cfq_account_completion() inside the ->in_flight check.
Signed-off-by: default avatarJens Axboe <axboe@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3339493f
...@@ -1285,19 +1285,19 @@ static int cfq_queue_empty(request_queue_t *q) ...@@ -1285,19 +1285,19 @@ static int cfq_queue_empty(request_queue_t *q)
static void cfq_completed_request(request_queue_t *q, struct request *rq) static void cfq_completed_request(request_queue_t *q, struct request *rq)
{ {
struct cfq_rq *crq = RQ_DATA(rq); struct cfq_rq *crq = RQ_DATA(rq);
struct cfq_queue *cfqq;
if (unlikely(!blk_fs_request(rq))) if (unlikely(!blk_fs_request(rq)))
return; return;
if (crq->in_flight) { cfqq = crq->cfq_queue;
struct cfq_queue *cfqq = crq->cfq_queue;
if (crq->in_flight) {
WARN_ON(!cfqq->in_flight); WARN_ON(!cfqq->in_flight);
cfqq->in_flight--; cfqq->in_flight--;
cfq_account_completion(cfqq, crq);
} }
cfq_account_completion(cfqq, crq);
} }
static struct request * static struct request *
......
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