aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index da36a3a81a9e..9032e910bca3 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -900,11 +900,23 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
900 action = ACTION_FAIL; 900 action = ACTION_FAIL;
901 error = -EILSEQ; 901 error = -EILSEQ;
902 /* INVALID COMMAND OPCODE or INVALID FIELD IN CDB */ 902 /* INVALID COMMAND OPCODE or INVALID FIELD IN CDB */
903 } else if ((sshdr.asc == 0x20 || sshdr.asc == 0x24) && 903 } else if (sshdr.asc == 0x20 || sshdr.asc == 0x24) {
904 (cmd->cmnd[0] == UNMAP || 904 switch (cmd->cmnd[0]) {
905 cmd->cmnd[0] == WRITE_SAME_16 || 905 case UNMAP:
906 cmd->cmnd[0] == WRITE_SAME)) { 906 description = "Discard failure";
907 description = "Discard failure"; 907 break;
908 case WRITE_SAME:
909 case WRITE_SAME_16:
910 if (cmd->cmnd[1] & 0x8)
911 description = "Discard failure";
912 else
913 description =
914 "Write same failure";
915 break;
916 default:
917 description = "Invalid command failure";
918 break;
919 }
908 action = ACTION_FAIL; 920 action = ACTION_FAIL;
909 error = -EREMOTEIO; 921 error = -EREMOTEIO;
910 } else 922 } else