Commit 93803e01 authored by Jens Axboe's avatar Jens Axboe

cfq-iosched: fix race in cfq_set_request()

We need to hold the queue lock over the reference increment,
it's not atomic anymore.
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent da527770
...@@ -3675,12 +3675,11 @@ cfq_set_request(struct request_queue *q, struct request *rq, gfp_t gfp_mask) ...@@ -3675,12 +3675,11 @@ cfq_set_request(struct request_queue *q, struct request *rq, gfp_t gfp_mask)
cfqq->allocated[rw]++; cfqq->allocated[rw]++;
spin_unlock_irqrestore(q->queue_lock, flags);
cfqq->ref++; cfqq->ref++;
rq->elevator_private[0] = cic; rq->elevator_private[0] = cic;
rq->elevator_private[1] = cfqq; rq->elevator_private[1] = cfqq;
rq->elevator_private[2] = cfq_ref_get_cfqg(cfqq->cfqg); rq->elevator_private[2] = cfq_ref_get_cfqg(cfqq->cfqg);
spin_unlock_irqrestore(q->queue_lock, flags);
return 0; return 0;
queue_fail: queue_fail:
......
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