Commit 5a659463 authored by James Bottomley's avatar James Bottomley Committed by James Bottomley

Add fastfail to SCSI

This is the preliminary version with no error indications or
control over the types of failures.
parent 177342da
......@@ -1285,7 +1285,12 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
maybe_retry:
if ((++scmd->retries) < scmd->allowed) {
/* we requeue for retry because the error was retryable, and
* the request was not marked fast fail. Note that above,
* even if the request is marked fast fail, we still requeue
* for queue congestion conditions (QUEUE_FULL or BUSY) */
if ((++scmd->retries) < scmd->allowed
&& !blk_noretry_request(scmd->request)) {
return NEEDS_RETRY;
} else {
/*
......
......@@ -502,15 +502,23 @@ static struct scsi_cmnd *scsi_end_request(struct scsi_cmnd *cmd, int uptodate,
* to queue the remainder of them.
*/
if (end_that_request_first(req, uptodate, sectors)) {
if (requeue) {
int leftover = req->hard_nr_sectors - sectors;
/* kill remainder if no retrys */
if (!uptodate && blk_noretry_request(req))
end_that_request_first(req, 0, leftover);
else {
if (requeue)
/*
* Bleah. Leftovers again. Stick the leftovers in
* the front of the queue, and goose the queue again.
* Bleah. Leftovers again. Stick the
* leftovers in the front of the
* queue, and goose the queue again.
*/
scsi_requeue_command(q, cmd);
}
return cmd;
}
}
add_disk_randomness(req->rq_disk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment