From: <vl...@us...> - 2012-04-26 18:41:21
|
Revision: 4238 http://scst.svn.sourceforge.net/scst/?rev=4238&view=rev Author: vlnb Date: 2012-04-26 18:41:14 +0000 (Thu, 26 Apr 2012) Log Message: ----------- Fix incorrect state check in the debug trap reported by Bart Van Assche <bva...@ac...> Modified Paths: -------------- trunk/scst/src/scst_targ.c Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2012-04-26 12:50:50 UTC (rev 4237) +++ trunk/scst/src/scst_targ.c 2012-04-26 18:41:14 UTC (rev 4238) @@ -882,16 +882,18 @@ #ifdef CONFIG_SCST_EXTRACHECKS /* * At this point either data_len must be initialized, or cmd - * completed (with an error). + * completed (with an error) and correct state set. */ if (unlikely((cmd->data_len == SCST_DEF_DATA_LEN)) && - (!cmd->completed || ((cmd->state <= SCST_CMD_STATE_REAL_EXEC) && - (cmd->state != SCST_CMD_STATE_PREPROCESSING_DONE)))) { + (!cmd->completed || + (((cmd->state <= SCST_CMD_STATE_PRE_XMIT_RESP) || + (cmd->state >= SCST_CMD_STATE_LAST_ACTIVE)) && + (cmd->state != SCST_CMD_STATE_PREPROCESSING_DONE)))) { PRINT_CRIT_ERROR("Not initialized data_len for going to " - "execute command (cmd %p, data_len %d, completed %d, " - "state %d)", cmd, cmd->data_len, cmd->completed, - cmd->state); - WARN_ON(1); + "execute command or bad state (cmd %p, data_len %d, " + "completed %d, state %d)", cmd, cmd->data_len, + cmd->completed, cmd->state); + sBUG(); goto out_hw_error; } #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |