hpsa: report check condition even if no sense data present for ioaccel2 mode
authorStephen M. Cameron <scameron@beardog.cce.hp.com>
Thu, 29 May 2014 15:53:54 +0000 (10:53 -0500)
committerChristoph Hellwig <hch@lst.de>
Mon, 2 Jun 2014 07:55:00 +0000 (09:55 +0200)
It shouldn't happen that we get a check condition with no sense data, but if it
does, we shouldn't just drop the check condition on the floor.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reviewed-by: Justin Lindley <justin.lindley@hp.com>
Reviewed-by: Mike Miller <michael.miller@canonical.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/hpsa.c

index 836c6c013ee8d3cc7e28974d217df45fdd19f99f..a1cec91240ab83ef7c554e3fe90c63e9cdc53af9 100644 (file)
@@ -1556,9 +1556,13 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h,
                        dev_warn(&h->pdev->dev,
                                "%s: task complete with check condition.\n",
                                "HP SSD Smart Path");
+                       cmd->result |= SAM_STAT_CHECK_CONDITION;
                        if (c2->error_data.data_present !=
-                                       IOACCEL2_SENSE_DATA_PRESENT)
+                                       IOACCEL2_SENSE_DATA_PRESENT) {
+                               memset(cmd->sense_buffer, 0,
+                                       SCSI_SENSE_BUFFERSIZE);
                                break;
+                       }
                        /* copy the sense data */
                        data_len = c2->error_data.sense_data_len;
                        if (data_len > SCSI_SENSE_BUFFERSIZE)
@@ -1568,7 +1572,6 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h,
                                        sizeof(c2->error_data.sense_data_buff);
                        memcpy(cmd->sense_buffer,
                                c2->error_data.sense_data_buff, data_len);
-                       cmd->result |= SAM_STAT_CHECK_CONDITION;
                        retry = 1;
                        break;
                case IOACCEL2_STATUS_SR_TASK_COMP_BUSY:
This page took 0.031208 seconds and 5 git commands to generate.