diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-timeout.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/block/blk-timeout.c b/block/blk-timeout.c index a09535377a94..bbbdc4b8ccf2 100644 --- a/block/blk-timeout.c +++ b/block/blk-timeout.c | |||
@@ -209,12 +209,19 @@ void blk_abort_queue(struct request_queue *q) | |||
209 | { | 209 | { |
210 | unsigned long flags; | 210 | unsigned long flags; |
211 | struct request *rq, *tmp; | 211 | struct request *rq, *tmp; |
212 | LIST_HEAD(list); | ||
212 | 213 | ||
213 | spin_lock_irqsave(q->queue_lock, flags); | 214 | spin_lock_irqsave(q->queue_lock, flags); |
214 | 215 | ||
215 | elv_abort_queue(q); | 216 | elv_abort_queue(q); |
216 | 217 | ||
217 | list_for_each_entry_safe(rq, tmp, &q->timeout_list, timeout_list) | 218 | /* |
219 | * Splice entries to local list, to avoid deadlocking if entries | ||
220 | * get readded to the timeout list by error handling | ||
221 | */ | ||
222 | list_splice_init(&q->timeout_list, &list); | ||
223 | |||
224 | list_for_each_entry_safe(rq, tmp, &list, timeout_list) | ||
218 | blk_abort_request(rq); | 225 | blk_abort_request(rq); |
219 | 226 | ||
220 | spin_unlock_irqrestore(q->queue_lock, flags); | 227 | spin_unlock_irqrestore(q->queue_lock, flags); |