Fixes broken REQUEST SENSE

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@410 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2008-06-12 18:37:31 +00:00
parent 0cfbfa801c
commit 2cd7071377
2 changed files with 7 additions and 4 deletions

View File

@@ -906,7 +906,7 @@ struct scst_cmd *scst_create_prepare_internal_cmd(
res->cmd_lists = orig_cmd->cmd_lists;
res->sess = orig_cmd->sess;
res->state = SCST_CMD_STATE_DEV_PARSE;
res->state = SCST_CMD_STATE_PRE_PARSE;
res->atomic = scst_cmd_atomic(orig_cmd);
res->internal = 1;
res->tgtt = orig_cmd->tgtt;

View File

@@ -2177,15 +2177,18 @@ static int scst_check_auto_sense(struct scst_cmd *cmd)
return res;
}
static int scst_done_cmd_check(struct scst_cmd *cmd, int *pres)
static int scst_done_cmd_check(struct scst_cmd **pcmd, int *pres)
{
int res = 0, rc;
struct scst_cmd *cmd = *pcmd;
TRACE_ENTRY();
if (unlikely(cmd->cdb[0] == REQUEST_SENSE)) {
if (cmd->internal)
if (cmd->internal) {
cmd = scst_complete_request_sense(cmd);
*pcmd = cmd;
}
} else if (unlikely(scst_check_auto_sense(cmd))) {
PRINT_INFO("Command finished with CHECK CONDITION, but "
"without sense data (opcode 0x%x), issuing "
@@ -2323,7 +2326,7 @@ static int scst_pre_dev_done(struct scst_cmd *cmd)
TRACE_ENTRY();
rc = scst_done_cmd_check(cmd, &res);
rc = scst_done_cmd_check(&cmd, &res);
if (rc)
goto out;