aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ibmvscsi
diff options
context:
space:
mode:
authorBrian King <brking@linux.vnet.ibm.com>2008-10-29 09:46:36 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-12-29 12:24:12 -0500
commit50119dad2a6c2674f35d81e708822b40f65f40cb (patch)
tree88c2ea1a7d625acfd8d9ac16ea98ac60faa6e1d5 /drivers/scsi/ibmvscsi
parent596891acd774f515c2a43adda9322d6a9b2b51b9 (diff)
[SCSI] ibmvfc: Fix error reporting for some FC errors
If either a "transport fault" or a "general transport" error is received and no other error information is available, the command is improperly returned as successful. Fix this to return DID_ERROR in this case. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/ibmvscsi')
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 7650707a40de..ae65fa60eeb4 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -278,13 +278,6 @@ static int ibmvfc_get_err_result(struct ibmvfc_cmd *vfc_cmd)
278 rsp->data.info.rsp_code)) 278 rsp->data.info.rsp_code))
279 return DID_ERROR << 16; 279 return DID_ERROR << 16;
280 280
281 if (!vfc_cmd->status) {
282 if (rsp->flags & FCP_RESID_OVER)
283 return rsp->scsi_status | (DID_ERROR << 16);
284 else
285 return rsp->scsi_status | (DID_OK << 16);
286 }
287
288 err = ibmvfc_get_err_index(vfc_cmd->status, vfc_cmd->error); 281 err = ibmvfc_get_err_index(vfc_cmd->status, vfc_cmd->error);
289 if (err >= 0) 282 if (err >= 0)
290 return rsp->scsi_status | (cmd_status[err].result << 16); 283 return rsp->scsi_status | (cmd_status[err].result << 16);
@@ -1478,6 +1471,9 @@ static void ibmvfc_scsi_done(struct ibmvfc_event *evt)
1478 if ((rsp->flags & FCP_SNS_LEN_VALID) && rsp->fcp_sense_len && rsp_len <= 8) 1471 if ((rsp->flags & FCP_SNS_LEN_VALID) && rsp->fcp_sense_len && rsp_len <= 8)
1479 memcpy(cmnd->sense_buffer, rsp->data.sense + rsp_len, sense_len); 1472 memcpy(cmnd->sense_buffer, rsp->data.sense + rsp_len, sense_len);
1480 1473
1474 if (!cmnd->result && (!scsi_get_resid(cmnd) || (rsp->flags & FCP_RESID_OVER)))
1475 cmnd->result = (DID_ERROR << 16);
1476
1481 ibmvfc_log_error(evt); 1477 ibmvfc_log_error(evt);
1482 } 1478 }
1483 1479