Skip to content

Commit

Permalink
[SCSI] sd: Combine DIF/DIX error handling
Browse files Browse the repository at this point in the history
DIF and DIX errors are handled identically at this point.  Collapse the
switch cases into one and let scsi_io_completion print result and sense
data.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Martin K. Petersen authored and James Bottomley committed Feb 9, 2010
1 parent d44a6d2 commit fa4698f
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1196,19 +1196,10 @@ static int sd_done(struct scsi_cmnd *SCpnt)
SCpnt->result = 0;
memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
break;
case ABORTED_COMMAND:
if (sshdr.asc == 0x10) { /* DIF: Disk detected corruption */
scsi_print_result(SCpnt);
scsi_print_sense("sd", SCpnt);
case ABORTED_COMMAND: /* DIF: Target detected corruption */
case ILLEGAL_REQUEST: /* DIX: Host detected corruption */
if (sshdr.asc == 0x10)
good_bytes = sd_completed_bytes(SCpnt);
}
break;
case ILLEGAL_REQUEST:
if (sshdr.asc == 0x10) { /* DIX: HBA detected corruption */
scsi_print_result(SCpnt);
scsi_print_sense("sd", SCpnt);
good_bytes = sd_completed_bytes(SCpnt);
}
break;
default:
break;
Expand Down

0 comments on commit fa4698f

Please sign in to comment.