diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-03-18 13:51:29 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2006-03-18 18:33:51 -0500 |
commit | c981ff9f893b9ab229a809f8ad287ae43fc17a64 (patch) | |
tree | c0423d86a33f0f714fa192b4f964269889b12c3f | |
parent | 8669aafdb5a46a57366dd1540fc475544071a9c9 (diff) |
[PATCH] fix locking in queue_requests_store()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | block/ll_rw_blk.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 5fac138a5be1..caa8fcf5474b 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -3614,10 +3614,13 @@ static ssize_t | |||
3614 | queue_requests_store(struct request_queue *q, const char *page, size_t count) | 3614 | queue_requests_store(struct request_queue *q, const char *page, size_t count) |
3615 | { | 3615 | { |
3616 | struct request_list *rl = &q->rq; | 3616 | struct request_list *rl = &q->rq; |
3617 | unsigned long nr; | ||
3618 | int ret = queue_var_store(&nr, page, count); | ||
3619 | if (nr < BLKDEV_MIN_RQ) | ||
3620 | nr = BLKDEV_MIN_RQ; | ||
3617 | 3621 | ||
3618 | int ret = queue_var_store(&q->nr_requests, page, count); | 3622 | spin_lock_irq(q->queue_lock); |
3619 | if (q->nr_requests < BLKDEV_MIN_RQ) | 3623 | q->nr_requests = nr; |
3620 | q->nr_requests = BLKDEV_MIN_RQ; | ||
3621 | blk_queue_congestion_threshold(q); | 3624 | blk_queue_congestion_threshold(q); |
3622 | 3625 | ||
3623 | if (rl->count[READ] >= queue_congestion_on_threshold(q)) | 3626 | if (rl->count[READ] >= queue_congestion_on_threshold(q)) |
@@ -3643,6 +3646,7 @@ queue_requests_store(struct request_queue *q, const char *page, size_t count) | |||
3643 | blk_clear_queue_full(q, WRITE); | 3646 | blk_clear_queue_full(q, WRITE); |
3644 | wake_up(&rl->wait[WRITE]); | 3647 | wake_up(&rl->wait[WRITE]); |
3645 | } | 3648 | } |
3649 | spin_unlock_irq(q->queue_lock); | ||
3646 | return ret; | 3650 | return ret; |
3647 | } | 3651 | } |
3648 | 3652 | ||