diff options
Diffstat (limited to 'block/blk-timeout.c')
| -rw-r--r-- | block/blk-timeout.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/block/blk-timeout.c b/block/blk-timeout.c index bbbdc4b8ccf2..1ec0d503cacd 100644 --- a/block/blk-timeout.c +++ b/block/blk-timeout.c | |||
| @@ -211,6 +211,12 @@ void blk_abort_queue(struct request_queue *q) | |||
| 211 | struct request *rq, *tmp; | 211 | struct request *rq, *tmp; |
| 212 | LIST_HEAD(list); | 212 | LIST_HEAD(list); |
| 213 | 213 | ||
| 214 | /* | ||
| 215 | * Not a request based block device, nothing to abort | ||
| 216 | */ | ||
| 217 | if (!q->request_fn) | ||
| 218 | return; | ||
| 219 | |||
| 214 | spin_lock_irqsave(q->queue_lock, flags); | 220 | spin_lock_irqsave(q->queue_lock, flags); |
| 215 | 221 | ||
| 216 | elv_abort_queue(q); | 222 | elv_abort_queue(q); |
| @@ -224,6 +230,13 @@ void blk_abort_queue(struct request_queue *q) | |||
| 224 | list_for_each_entry_safe(rq, tmp, &list, timeout_list) | 230 | list_for_each_entry_safe(rq, tmp, &list, timeout_list) |
| 225 | blk_abort_request(rq); | 231 | blk_abort_request(rq); |
| 226 | 232 | ||
| 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 | |||
| 227 | spin_unlock_irqrestore(q->queue_lock, flags); | 240 | spin_unlock_irqrestore(q->queue_lock, flags); |
| 228 | 241 | ||
| 229 | } | 242 | } |
