]> git.hungrycats.org Git - linux/commitdiff
Add fastfail to SCSI
authorJames Bottomley <jejb@raven.il.steeleye.com>
Sat, 16 Aug 2003 03:50:55 +0000 (22:50 -0500)
committerJames Bottomley <jejb@fuzzy.(none)>
Sat, 16 Aug 2003 03:50:55 +0000 (22:50 -0500)
This is the preliminary version with no error indications or
control over the types of failures.

drivers/scsi/scsi_error.c
drivers/scsi/scsi_lib.c

index f5d18f74beaf26e06241842761b9ff3feb9c862a..6e4906ab224177c961604fa8471b0f42224d7253 100644 (file)
@@ -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 {
                /*
index ef55ac3f119fa4d2ab8d919f605cc2dadc5ea660..415be0cf47b060a4117bf915d40d26583ebed383 100644 (file)
@@ -502,14 +502,22 @@ 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) {
-                       /*
-                        * Bleah.  Leftovers again.  Stick the leftovers in
-                        * the front of the queue, and goose the queue again.
-                        */
-                       scsi_requeue_command(q, cmd);
+               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.
+                                */
+                               scsi_requeue_command(q, cmd);
+
+                       return cmd;
                }
-               return cmd;
        }
 
        add_disk_randomness(req->rq_disk);