Skip to content

Commit

Permalink
block: fix intermittent dm timeout based oops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
hreinecke authored and Jens Axboe committed Apr 24, 2009
1 parent f3c737d commit 17d5c8c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions block/blk-timeout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}
Expand Down

0 comments on commit 17d5c8c

Please sign in to comment.