[PATCH] Fix get_request nastiness
authorHugh Dickins <hugh@veritas.com>
Wed, 29 Jun 2005 14:15:40 +0000 (15:15 +0100)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 29 Jun 2005 15:46:30 +0000 (08:46 -0700)
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>
drivers/block/ll_rw_blk.c

index 1197462bb6bae32d2f50d0091abe20e6bfbd7cb2..692a5fced76e448819f4e649cd5576a066deae4f 100644 (file)
@@ -1917,10 +1917,9 @@ get_rq:
         * 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))