diff options
| -rw-r--r-- | drivers/block/elevator.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c index 6b79b4314622..8c51d1ccebbd 100644 --- a/drivers/block/elevator.c +++ b/drivers/block/elevator.c | |||
| @@ -291,6 +291,13 @@ void elv_requeue_request(request_queue_t *q, struct request *rq) | |||
| 291 | } | 291 | } |
| 292 | 292 | ||
| 293 | /* | 293 | /* |
| 294 | * the request is prepped and may have some resources allocated. | ||
| 295 | * allowing unprepped requests to pass this one may cause resource | ||
| 296 | * deadlock. turn on softbarrier. | ||
| 297 | */ | ||
| 298 | rq->flags |= REQ_SOFTBARRIER; | ||
| 299 | |||
| 300 | /* | ||
| 294 | * if iosched has an explicit requeue hook, then use that. otherwise | 301 | * if iosched has an explicit requeue hook, then use that. otherwise |
| 295 | * just put the request at the front of the queue | 302 | * just put the request at the front of the queue |
| 296 | */ | 303 | */ |
| @@ -386,6 +393,12 @@ struct request *elv_next_request(request_queue_t *q) | |||
| 386 | if (ret == BLKPREP_OK) { | 393 | if (ret == BLKPREP_OK) { |
| 387 | break; | 394 | break; |
| 388 | } else if (ret == BLKPREP_DEFER) { | 395 | } else if (ret == BLKPREP_DEFER) { |
| 396 | /* | ||
| 397 | * the request may have been (partially) prepped. | ||
| 398 | * we need to keep this request in the front to | ||
| 399 | * avoid resource deadlock. turn on softbarrier. | ||
| 400 | */ | ||
| 401 | rq->flags |= REQ_SOFTBARRIER; | ||
| 389 | rq = NULL; | 402 | rq = NULL; |
| 390 | break; | 403 | break; |
| 391 | } else if (ret == BLKPREP_KILL) { | 404 | } else if (ret == BLKPREP_KILL) { |
