diff options
author | Tejun Heo <htejun@gmail.com> | 2005-06-16 06:57:31 -0400 |
---|---|---|
committer | Jens Axboe <axboe@suse.de> | 2005-06-16 06:57:31 -0400 |
commit | c374f127e4ff17a318b9ae95a5bf65f370c2d0b1 (patch) | |
tree | d1e42b31f9a66582096e9548fc90cc069d6f39e2 /drivers/block/elevator.c | |
parent | 9c56187d3c345cc0e7a2f162b8c32543175d7bf7 (diff) |
This patch fixes q->unplug_thresh condition check in
__elv_add_request(). rq.count[READ] + rq.count[WRITE] can increase
more than one if another thread has allocated a request after the
current request is allocated or in_flight could have changed resulting
in larger-than-one change of nrq, thus breaking the threshold
mechanism.
Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/block/elevator.c')
-rw-r--r-- | drivers/block/elevator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c index 98fcabbafe1e..89982925f9e2 100644 --- a/drivers/block/elevator.c +++ b/drivers/block/elevator.c | |||
@@ -317,7 +317,7 @@ void __elv_add_request(request_queue_t *q, struct request *rq, int where, | |||
317 | int nrq = q->rq.count[READ] + q->rq.count[WRITE] | 317 | int nrq = q->rq.count[READ] + q->rq.count[WRITE] |
318 | - q->in_flight; | 318 | - q->in_flight; |
319 | 319 | ||
320 | if (nrq == q->unplug_thresh) | 320 | if (nrq >= q->unplug_thresh) |
321 | __generic_unplug_device(q); | 321 | __generic_unplug_device(q); |
322 | } | 322 | } |
323 | } else | 323 | } else |