Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195566
b: refs/heads/master
c: b3ef990
h: refs/heads/master
v: v3
  • Loading branch information
Robert Love authored and James Bottomley committed Apr 11, 2010
1 parent 4c0dbad commit 92344ce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5c12c418e905aac2826bb70f947648944c079ed9
refs/heads/master: b3ef990c1514859bffae221b9e82e46a38f1e7bf
19 changes: 17 additions & 2 deletions trunk/drivers/scsi/libfc/fc_fcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1916,6 +1916,8 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
}
break;
case FC_ERROR:
FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml "
"due to FC_ERROR\n");
sc_cmd->result = DID_ERROR << 16;
break;
case FC_DATA_UNDRUN:
Expand All @@ -1924,12 +1926,19 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
* scsi status is good but transport level
* underrun.
*/
sc_cmd->result = (fsp->state & FC_SRB_RCV_STATUS ?
DID_OK : DID_ERROR) << 16;
if (fsp->state & FC_SRB_RCV_STATUS) {
sc_cmd->result = DID_OK << 16;
} else {
FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml"
" due to FC_DATA_UNDRUN (trans)\n");
sc_cmd->result = DID_ERROR << 16;
}
} else {
/*
* scsi got underrun, this is an error
*/
FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml "
"due to FC_DATA_UNDRUN (scsi)\n");
CMD_RESID_LEN(sc_cmd) = fsp->scsi_resid;
sc_cmd->result = (DID_ERROR << 16) | fsp->cdb_status;
}
Expand All @@ -1938,9 +1947,13 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
/*
* overrun is an error
*/
FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml "
"due to FC_DATA_OVRRUN\n");
sc_cmd->result = (DID_ERROR << 16) | fsp->cdb_status;
break;
case FC_CMD_ABORTED:
FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml "
"due to FC_CMD_ABORTED\n");
sc_cmd->result = (DID_ERROR << 16) | fsp->io_status;
break;
case FC_CMD_RECOVERY:
Expand All @@ -1953,6 +1966,8 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
sc_cmd->result = (DID_NO_CONNECT << 16);
break;
default:
FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml "
"due to unknown error\n");
sc_cmd->result = (DID_ERROR << 16);
break;
}
Expand Down

0 comments on commit 92344ce

Please sign in to comment.