Skip to content

Commit

Permalink
[PATCH] cfq-iosched: reverse bad reference count fix
Browse files Browse the repository at this point in the history
The reference count fix merged isn't fully bug free. It doesn't leak
now, but instead it crashes due to looking at freed memory. So for now,
lets reverse the change and I'll fix it for real next week.

Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jens Axboe authored and Linus Torvalds committed Sep 10, 2005
1 parent 3113997 commit 3579713
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2260,6 +2260,8 @@ static void cfq_put_cfqd(struct cfq_data *cfqd)
if (!atomic_dec_and_test(&cfqd->ref))
return;

blk_put_queue(q);

cfq_shutdown_timer_wq(cfqd);
q->elevator->elevator_data = NULL;

Expand Down Expand Up @@ -2316,6 +2318,7 @@ static int cfq_init_queue(request_queue_t *q, elevator_t *e)
e->elevator_data = cfqd;

cfqd->queue = q;
atomic_inc(&q->refcnt);

cfqd->max_queued = q->nr_requests / 4;
q->nr_batching = cfq_queued;
Expand Down

0 comments on commit 3579713

Please sign in to comment.