Skip to content

Commit

Permalink
[PATCH] Fix get_request nastiness
Browse files Browse the repository at this point in the history
get_request is now expected to be holding on to queue_lock, with interrupts
disabled, when it returns NULL; but one path forgot that, causing all kinds
of nastiness under swap load - badness backtraces, strange failures, BUGs.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Jun 29, 2005
1 parent 541ceca commit fd782a4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1917,10 +1917,9 @@ static struct request *get_request(request_queue_t *q, int rw, struct bio *bio,
* limit of requests, otherwise we could have thousands of requests
* allocated with any setting of ->nr_requests
*/
if (rl->count[rw] >= (3 * q->nr_requests / 2)) {
spin_unlock_irq(q->queue_lock);
if (rl->count[rw] >= (3 * q->nr_requests / 2))
goto out;
}

rl->count[rw]++;
rl->starved[rw] = 0;
if (rl->count[rw] >= queue_congestion_on_threshold(q))
Expand Down

0 comments on commit fd782a4

Please sign in to comment.