]> err.no Git - linux-2.6/commitdiff
[SCSI] Do not retry a request whose data integrity check failed
authorMartin K. Petersen <martin.petersen@oracle.com>
Thu, 17 Jul 2008 08:28:33 +0000 (04:28 -0400)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Sat, 26 Jul 2008 19:14:55 +0000 (15:14 -0400)
If initiator or target reject the I/O due to DIF errors there is no
point in retrying.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/scsi_error.c
drivers/scsi/scsi_lib.c

index a69397fd314a183077ffc023ac0d15ad236187d8..fc4b2d05f2e1df6b55bc0f6e889305ae3dced3f7 100644 (file)
@@ -344,6 +344,9 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
                return /* soft_error */ SUCCESS;
 
        case ABORTED_COMMAND:
+               if (sshdr.asc == 0x10) /* DIF */
+                       return SUCCESS;
+
                return NEEDS_RETRY;
        case NOT_READY:
        case UNIT_ATTENTION:
index a47c05d7829a617564c1fa8b51128565a9d07841..a20730c48020565ba49700f4c453512824fe4d8a 100644 (file)
@@ -950,9 +950,14 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
                                 * 6-byte command.
                                 */
                                scsi_requeue_command(q, cmd);
-                               return;
-                       } else {
+                       } else if (sshdr.asc == 0x10) /* DIX */
+                               scsi_end_request(cmd, -EIO, this_count, 0);
+                       else
                                scsi_end_request(cmd, -EIO, this_count, 1);
+                       return;
+               case ABORTED_COMMAND:
+                       if (sshdr.asc == 0x10) { /* DIF */
+                               scsi_end_request(cmd, -EIO, this_count, 0);
                                return;
                        }
                        break;