diff options
author | Jens Axboe <jaxboe@fusionio.com> | 2011-03-07 02:59:06 -0500 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-03-07 02:59:06 -0500 |
commit | 93803e0140c6216b68fe926ccc611297120da273 (patch) | |
tree | c70e354f3029a00f83293b0d6bedf6738437ebab /block/cfq-iosched.c | |
parent | da527770007fce8e4541947d47918248286da875 (diff) |
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: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 3202c7e87fb3..fb2141ec205c 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -3675,12 +3675,11 @@ new_queue: | |||
3675 | 3675 | ||
3676 | cfqq->allocated[rw]++; | 3676 | cfqq->allocated[rw]++; |
3677 | 3677 | ||
3678 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
3679 | |||
3680 | cfqq->ref++; | 3678 | cfqq->ref++; |
3681 | rq->elevator_private[0] = cic; | 3679 | rq->elevator_private[0] = cic; |
3682 | rq->elevator_private[1] = cfqq; | 3680 | rq->elevator_private[1] = cfqq; |
3683 | rq->elevator_private[2] = cfq_ref_get_cfqg(cfqq->cfqg); | 3681 | rq->elevator_private[2] = cfq_ref_get_cfqg(cfqq->cfqg); |
3682 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
3684 | return 0; | 3683 | return 0; |
3685 | 3684 | ||
3686 | queue_fail: | 3685 | queue_fail: |