aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorLinas Vepstas <linas@austin.ibm.com>2007-01-23 19:40:54 +0100
committerChris Wright <chrisw@sous-sol.org>2007-02-05 08:31:42 -0800
commitef7c3ade5615ed98d4567107eb627b962382a1b2 (patch)
tree74092964d5976bffabb77fe4be90a2b4f4c37e88 /block
parent19fad1a2ab244bec784fa252cff8d9bbb1f4f426 (diff)
[PATCH] elevator: move clearing of unplug flag earlier
A flag was recently added to the elevator code to avoid performing an unplug when reuests are being re-queued. The goal of this flag was to avoid a deep recursion that can occur when re-queueing requests after a SCSI device/host reset. See http://lkml.org/lkml/2006/5/17/254 However, that fix added the flag near the bottom of a case statement, where an earlier break (in an if statement) could transport one out of the case, without setting the flag. This patch sets the flag earlier in the case statement. I re-discovered the deep recursion recently during testing; I was told that it was a known problem, and the fix to it was in the kernel I was testing. Indeed it was ... but it didn't fix the bug. With the patch below, I no longer see the bug. Signed-off by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Diffstat (limited to 'block')
-rw-r--r--block/elevator.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/block/elevator.c b/block/elevator.c
index 8ccd163254b..68baa27f9ac 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -572,6 +572,12 @@ void elv_insert(request_queue_t *q, struct request *rq, int where)
*/
rq->cmd_flags |= REQ_SOFTBARRIER;
+ /*
+ * Most requeues happen because of a busy condition,
+ * don't force unplug of the queue for that case.
+ */
+ unplug_it = 0;
+
if (q->ordseq == 0) {
list_add(&rq->queuelist, &q->queue_head);
break;
@@ -586,11 +592,6 @@ void elv_insert(request_queue_t *q, struct request *rq, int where)
}
list_add_tail(&rq->queuelist, pos);
- /*
- * most requeues happen because of a busy condition, don't
- * force unplug of the queue for that case.
- */
- unplug_it = 0;
break;
default: