Skip to content

Commit 17d5c8c

Browse files
hreineckeJens Axboe
authored andcommitted
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>
1 parent f3c737d commit 17d5c8c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎block/blk-timeout.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,13 @@ void blk_abort_queue(struct request_queue *q)
230230
list_for_each_entry_safe(rq, tmp, &list, timeout_list)
231231
blk_abort_request(rq);
232232

233+
/*
234+
* Occasionally, blk_abort_request() will return without
235+
* deleting the element from the list. Make sure we add those back
236+
* instead of leaving them on the local stack list.
237+
*/
238+
list_splice(&list, &q->timeout_list);
239+
233240
spin_unlock_irqrestore(q->queue_lock, flags);
234241

235242
}

0 commit comments

Comments
 (0)