Commit ffd23335 authored by Jens Axboe's avatar Jens Axboe

[PATCH] missing lock in get_request_wait()

We must grab lock before checking rl->count.
parent 409499e9
...@@ -1358,11 +1358,19 @@ static struct request *get_request_wait(request_queue_t *q, int rw) ...@@ -1358,11 +1358,19 @@ static struct request *get_request_wait(request_queue_t *q, int rw)
generic_unplug_device(q); generic_unplug_device(q);
do { do {
int block = 0;
prepare_to_wait_exclusive(&rl->wait, &wait, prepare_to_wait_exclusive(&rl->wait, &wait,
TASK_UNINTERRUPTIBLE); TASK_UNINTERRUPTIBLE);
spin_lock_irq(q->queue_lock);
if (!rl->count) if (!rl->count)
block = 1;
spin_unlock_irq(q->queue_lock);
if (block)
io_schedule(); io_schedule();
finish_wait(&rl->wait, &wait); finish_wait(&rl->wait, &wait);
spin_lock_irq(q->queue_lock); spin_lock_irq(q->queue_lock);
rq = get_request(q, rw); rq = get_request(q, rw);
spin_unlock_irq(q->queue_lock); spin_unlock_irq(q->queue_lock);
......
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