aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/libfc/fc_fcp.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 39f18e39125c..044c420a1371 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -1916,6 +1916,8 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
1916 } 1916 }
1917 break; 1917 break;
1918 case FC_ERROR: 1918 case FC_ERROR:
1919 FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml "
1920 "due to FC_ERROR\n");
1919 sc_cmd->result = DID_ERROR << 16; 1921 sc_cmd->result = DID_ERROR << 16;
1920 break; 1922 break;
1921 case FC_DATA_UNDRUN: 1923 case FC_DATA_UNDRUN:
@@ -1924,12 +1926,19 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
1924 * scsi status is good but transport level 1926 * scsi status is good but transport level
1925 * underrun. 1927 * underrun.
1926 */ 1928 */
1927 sc_cmd->result = (fsp->state & FC_SRB_RCV_STATUS ? 1929 if (fsp->state & FC_SRB_RCV_STATUS) {
1928 DID_OK : DID_ERROR) << 16; 1930 sc_cmd->result = DID_OK << 16;
1931 } else {
1932 FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml"
1933 " due to FC_DATA_UNDRUN (trans)\n");
1934 sc_cmd->result = DID_ERROR << 16;
1935 }
1929 } else { 1936 } else {
1930 /* 1937 /*
1931 * scsi got underrun, this is an error 1938 * scsi got underrun, this is an error
1932 */ 1939 */
1940 FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml "
1941 "due to FC_DATA_UNDRUN (scsi)\n");
1933 CMD_RESID_LEN(sc_cmd) = fsp->scsi_resid; 1942 CMD_RESID_LEN(sc_cmd) = fsp->scsi_resid;
1934 sc_cmd->result = (DID_ERROR << 16) | fsp->cdb_status; 1943 sc_cmd->result = (DID_ERROR << 16) | fsp->cdb_status;
1935 } 1944 }
@@ -1938,9 +1947,13 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
1938 /* 1947 /*
1939 * overrun is an error 1948 * overrun is an error
1940 */ 1949 */
1950 FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml "
1951 "due to FC_DATA_OVRRUN\n");
1941 sc_cmd->result = (DID_ERROR << 16) | fsp->cdb_status; 1952 sc_cmd->result = (DID_ERROR << 16) | fsp->cdb_status;
1942 break; 1953 break;
1943 case FC_CMD_ABORTED: 1954 case FC_CMD_ABORTED:
1955 FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml "
1956 "due to FC_CMD_ABORTED\n");
1944 sc_cmd->result = (DID_ERROR << 16) | fsp->io_status; 1957 sc_cmd->result = (DID_ERROR << 16) | fsp->io_status;
1945 break; 1958 break;
1946 case FC_CMD_RECOVERY: 1959 case FC_CMD_RECOVERY:
@@ -1953,6 +1966,8 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
1953 sc_cmd->result = (DID_NO_CONNECT << 16); 1966 sc_cmd->result = (DID_NO_CONNECT << 16);
1954 break; 1967 break;
1955 default: 1968 default:
1969 FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml "
1970 "due to unknown error\n");
1956 sc_cmd->result = (DID_ERROR << 16); 1971 sc_cmd->result = (DID_ERROR << 16);
1957 break; 1972 break;
1958 } 1973 }