Follow up for the previous commit

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5139 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2013-12-05 04:15:42 +00:00
parent 26b9e5eaad
commit 70ce10d351
3 changed files with 26 additions and 6 deletions

View File

@@ -2985,6 +2985,27 @@ out:
}
EXPORT_SYMBOL(scst_cmd_set_write_not_received_data_len);
void scst_cmd_set_write_no_data_received(struct scst_cmd *cmd)
{
int w;
TRACE_ENTRY();
EXTRACHECKS_BUG_ON(cmd->expected_values_set &&
((cmd->expected_data_direction & SCST_DATA_WRITE) == 0));
if ((cmd->expected_data_direction & SCST_DATA_READ) &&
(cmd->expected_data_direction & SCST_DATA_WRITE))
w = cmd->expected_out_transfer_len;
else
w = cmd->expected_transfer_len;
scst_cmd_set_write_not_received_data_len(cmd, w);
TRACE_EXIT();
return;
}
/**
* __scst_get_resid() - returns residuals for cmd
*

View File

@@ -305,6 +305,8 @@ int scst_init_thread(void *arg);
int scst_tm_thread(void *arg);
int scst_global_mgmt_thread(void *arg);
void scst_cmd_set_write_no_data_received(struct scst_cmd *cmd);
void scst_zero_write_rest(struct scst_cmd *cmd);
void scst_limit_sg_write_len(struct scst_cmd *cmd);
void scst_adjust_resp_data_len(struct scst_cmd *cmd);

View File

@@ -1521,8 +1521,7 @@ void scst_rx_data(struct scst_cmd *cmd, int status,
case SCST_RX_STATUS_ERROR_SENSE_SET:
if (!cmd->write_not_received_set)
scst_cmd_set_write_not_received_data_len(cmd,
cmd->expected_transfer_len);
scst_cmd_set_write_no_data_received(cmd);
scst_set_cmd_abnormal_done_state(cmd);
pref_context = SCST_CONTEXT_THREAD;
break;
@@ -1532,8 +1531,7 @@ void scst_rx_data(struct scst_cmd *cmd, int status,
/* go through */
case SCST_RX_STATUS_ERROR:
if (!cmd->write_not_received_set)
scst_cmd_set_write_not_received_data_len(cmd,
cmd->expected_transfer_len);
scst_cmd_set_write_no_data_received(cmd);
scst_set_cmd_error(cmd,
SCST_LOAD_SENSE(scst_sense_hardw_error));
scst_set_cmd_abnormal_done_state(cmd);
@@ -1544,8 +1542,7 @@ void scst_rx_data(struct scst_cmd *cmd, int status,
PRINT_ERROR("scst_rx_data() received unknown status %x",
status);
if (!cmd->write_not_received_set)
scst_cmd_set_write_not_received_data_len(cmd,
cmd->expected_transfer_len);
scst_cmd_set_write_no_data_received(cmd);
scst_set_cmd_abnormal_done_state(cmd);
pref_context = SCST_CONTEXT_THREAD;
break;