aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-07-09 08:52:32 -0400
committerJens Axboe <axboe@carl.(none)>2009-07-10 14:31:53 -0400
commit8aa7e847d834ed937a9ad37a0f2ad5b8584c1ab0 (patch)
tree76c8b4f1362a928d426f2201790ab5d128f57724 /drivers/block
parentc2cc49a2f8a479dde96a599646d30b6cc9dbed78 (diff)
Fix congestion_wait() sync/async vs read/write confusion
Commit 1faa16d22877f4839bd433547d770c676d1d964c accidentally broke the bdi congestion wait queue logic, causing us to wait on congestion for WRITE (== 1) when we really wanted BLK_RW_ASYNC (== 0) instead. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/pktcdvd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 83650e00632d..99a506f619b7 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -1372,8 +1372,10 @@ try_next_bio:
1372 wakeup = (pd->write_congestion_on > 0 1372 wakeup = (pd->write_congestion_on > 0
1373 && pd->bio_queue_size <= pd->write_congestion_off); 1373 && pd->bio_queue_size <= pd->write_congestion_off);
1374 spin_unlock(&pd->lock); 1374 spin_unlock(&pd->lock);
1375 if (wakeup) 1375 if (wakeup) {
1376 clear_bdi_congested(&pd->disk->queue->backing_dev_info, WRITE); 1376 clear_bdi_congested(&pd->disk->queue->backing_dev_info,
1377 BLK_RW_ASYNC);
1378 }
1377 1379
1378 pkt->sleep_time = max(PACKET_WAIT_TIME, 1); 1380 pkt->sleep_time = max(PACKET_WAIT_TIME, 1);
1379 pkt_set_state(pkt, PACKET_WAITING_STATE); 1381 pkt_set_state(pkt, PACKET_WAITING_STATE);
@@ -2592,10 +2594,10 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio)
2592 spin_lock(&pd->lock); 2594 spin_lock(&pd->lock);
2593 if (pd->write_congestion_on > 0 2595 if (pd->write_congestion_on > 0
2594 && pd->bio_queue_size >= pd->write_congestion_on) { 2596 && pd->bio_queue_size >= pd->write_congestion_on) {
2595 set_bdi_congested(&q->backing_dev_info, WRITE); 2597 set_bdi_congested(&q->backing_dev_info, BLK_RW_ASYNC);
2596 do { 2598 do {
2597 spin_unlock(&pd->lock); 2599 spin_unlock(&pd->lock);
2598 congestion_wait(WRITE, HZ); 2600 congestion_wait(BLK_RW_ASYNC, HZ);
2599 spin_lock(&pd->lock); 2601 spin_lock(&pd->lock);
2600 } while(pd->bio_queue_size > pd->write_congestion_off); 2602 } while(pd->bio_queue_size > pd->write_congestion_off);
2601 } 2603 }