]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
scsi: arcmsr: Fix command result for CHECK_CONDITION
authorChing Huang <ching2048@areca.com.tw>
Tue, 5 Dec 2017 03:28:37 +0000 (11:28 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 7 Dec 2017 00:32:42 +0000 (19:32 -0500)
Fix report command result error when CHECK_CONDITION.

Signed-off-by: Ching Huang <ching2048@areca.com.tw>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/arcmsr/arcmsr_hba.c

index 6d165e5fef15dd43905d1e11ba5c0993003a760a..0707a60bf5c0bf7887972ea7619daeea7722d919 100644 (file)
@@ -1205,7 +1205,7 @@ static void arcmsr_report_sense_info(struct CommandControlBlock *ccb)
 
        struct scsi_cmnd *pcmd = ccb->pcmd;
        struct SENSE_DATA *sensebuffer = (struct SENSE_DATA *)pcmd->sense_buffer;
-       pcmd->result = DID_OK << 16;
+       pcmd->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
        if (sensebuffer) {
                int sense_data_length =
                        sizeof(struct SENSE_DATA) < SCSI_SENSE_BUFFERSIZE
@@ -1214,6 +1214,7 @@ static void arcmsr_report_sense_info(struct CommandControlBlock *ccb)
                memcpy(sensebuffer, ccb->arcmsr_cdb.SenseData, sense_data_length);
                sensebuffer->ErrorCode = SCSI_SENSE_CURRENT_ERRORS;
                sensebuffer->Valid = 1;
+               pcmd->result |= (DRIVER_SENSE << 24);
        }
 }