Fix problem with handling internal commands reported by Hiroyuki Sato <hiroysato@gmail.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3248 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2011-02-13 17:01:19 +00:00
parent 0c80b9888c
commit 7f0a738c11
3 changed files with 8 additions and 1 deletions

View File

@@ -1976,6 +1976,7 @@ int scst_set_cmd_abnormal_done_state(struct scst_cmd *cmd)
case SCST_CMD_STATE_PRE_DEV_DONE:
case SCST_CMD_STATE_MODE_SELECT_CHECKS:
case SCST_CMD_STATE_PRE_XMIT_RESP:
case SCST_CMD_STATE_FINISHED_INTERNAL:
break;
default:
PRINT_CRIT_ERROR("Wrong cmd state %d (cmd %p, op %x)",
@@ -3686,6 +3687,7 @@ static struct scst_cmd *scst_create_prepare_internal_cmd(
unsigned int cdb_len, int bufsize)
{
struct scst_cmd *res;
int rc;
gfp_t gfp_mask = scst_cmd_atomic(orig_cmd) ? GFP_ATOMIC : GFP_KERNEL;
TRACE_ENTRY();
@@ -3712,6 +3714,9 @@ static struct scst_cmd *scst_create_prepare_internal_cmd(
if (res->tgt_dev != NULL)
res->cpu_cmd_counter = scst_get();
rc = scst_pre_parse(res);
sBUG_ON(rc != 0);
res->state = SCST_CMD_STATE_PARSE;
out:

View File

@@ -290,6 +290,8 @@ void scst_unblock_deferred(struct scst_tgt_dev *tgt_dev,
void scst_on_hq_cmd_response(struct scst_cmd *cmd);
void scst_xmit_process_aborted_cmd(struct scst_cmd *cmd);
int scst_pre_parse(struct scst_cmd *cmd);
int scst_cmd_thread(void *arg);
void scst_cmd_tasklet(long p);
int scst_init_thread(void *arg);

View File

@@ -394,7 +394,7 @@ out:
}
EXPORT_SYMBOL(scst_cmd_init_done);
static int scst_pre_parse(struct scst_cmd *cmd)
int scst_pre_parse(struct scst_cmd *cmd)
{
int res;
struct scst_device *dev = cmd->dev;