summaryrefslogtreecommitdiffstats
path: root/block/blk-timeout.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2009-04-23 10:32:59 +0200
committerJens Axboe <jens.axboe@oracle.com>2009-04-24 08:54:21 +0200
commit17d5c8ca7572124c9623045f24b0c21d4aa2b47f (patch)
treedfecc3aa2acae305c01238002a3e53d6ae8d3238 /block/blk-timeout.c
parentf3c737de8f57b5ce756010c2175f7d574194b30d (diff)
downloadlinux-17d5c8ca7572124c9623045f24b0c21d4aa2b47f.tar.gz
linux-17d5c8ca7572124c9623045f24b0c21d4aa2b47f.tar.bz2
linux-17d5c8ca7572124c9623045f24b0c21d4aa2b47f.zip
block: fix intermittent dm timeout based oops
Very rarely under stress testing of dm, oopses are occuring as something tampers with an old stack frame. This has been traced back to blk_abort_queue() leaving a timeout_list pointing to the stack. The reason is that sometimes blk_abort_request() won't delete the timer (if the request is marked as complete but before the timer has been removed, a small race window). Fix this by splicing back from the ususally empty list to the q->timeout_list. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-timeout.c')
-rw-r--r--block/blk-timeout.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index 8f570c4c80ee..1ec0d503cacd 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -230,6 +230,13 @@ void blk_abort_queue(struct request_queue *q)
list_for_each_entry_safe(rq, tmp, &list, timeout_list)
blk_abort_request(rq);
+ /*
+ * Occasionally, blk_abort_request() will return without
+ * deleting the element from the list. Make sure we add those back
+ * instead of leaving them on the local stack list.
+ */
+ list_splice(&list, &q->timeout_list);
+
spin_unlock_irqrestore(q->queue_lock, flags);
}