提交 2e759cd4 编写于 作者: T Tejun Heo 提交者: James Bottomley

[SCSI] make blk layer set REQ_SOFTBARRIER on defer and requeue

This is the reworked version of the patch.  It sets REQ_SOFTBARRIER
in two places - in elv_next_request() on BLKPREP_DEFER and in
blk_requeue_request().
Signed-off-by: NTejun Heo <htejun@gmail.com>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 354d6b21
...@@ -290,6 +290,13 @@ void elv_requeue_request(request_queue_t *q, struct request *rq) ...@@ -290,6 +290,13 @@ void elv_requeue_request(request_queue_t *q, struct request *rq)
rq = rq->end_io_data; rq = rq->end_io_data;
} }
/*
* the request is prepped and may have some resources allocated.
* allowing unprepped requests to pass this one may cause resource
* deadlock. turn on softbarrier.
*/
rq->flags |= REQ_SOFTBARRIER;
/* /*
* if iosched has an explicit requeue hook, then use that. otherwise * if iosched has an explicit requeue hook, then use that. otherwise
* just put the request at the front of the queue * just put the request at the front of the queue
...@@ -386,6 +393,12 @@ struct request *elv_next_request(request_queue_t *q) ...@@ -386,6 +393,12 @@ struct request *elv_next_request(request_queue_t *q)
if (ret == BLKPREP_OK) { if (ret == BLKPREP_OK) {
break; break;
} else if (ret == BLKPREP_DEFER) { } else if (ret == BLKPREP_DEFER) {
/*
* the request may have been (partially) prepped.
* we need to keep this request in the front to
* avoid resource deadlock. turn on softbarrier.
*/
rq->flags |= REQ_SOFTBARRIER;
rq = NULL; rq = NULL;
break; break;
} else if (ret == BLKPREP_KILL) { } else if (ret == BLKPREP_KILL) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册