|
From: <vl...@us...> - 2009-10-29 19:18:16
|
Revision: 1300
http://scst.svn.sourceforge.net/scst/?rev=1300&view=rev
Author: vlnb
Date: 2009-10-29 19:18:09 +0000 (Thu, 29 Oct 2009)
Log Message:
-----------
Fix for the wrong mcmd state assignment if scst_mgmt_translate_lun() returns >0 because of suspending. Found by Gilad / <gil...@gm...>
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2009-10-29 18:56:23 UTC (rev 1299)
+++ trunk/scst/src/scst_targ.c 2009-10-29 19:18:09 UTC (rev 1300)
@@ -4398,8 +4398,6 @@
TRACE_ENTRY();
- mcmd->state = SCST_MCMD_STATE_READY;
-
switch (mcmd->fn) {
case SCST_ABORT_TASK:
{
@@ -4454,6 +4452,7 @@
case SCST_NEXUS_LOSS:
case SCST_ABORT_ALL_TASKS:
case SCST_UNREG_SESS_TM:
+ mcmd->state = SCST_MCMD_STATE_READY;
break;
case SCST_ABORT_TASK_SET:
@@ -4461,12 +4460,14 @@
case SCST_CLEAR_TASK_SET:
case SCST_LUN_RESET:
rc = scst_mgmt_translate_lun(mcmd);
- if (rc < 0) {
+ if (rc == 0)
+ mcmd->state = SCST_MCMD_STATE_READY;
+ else if (rc < 0) {
PRINT_ERROR("Corresponding device for LUN %lld not "
"found", (long long unsigned int)mcmd->lun);
mcmd->status = SCST_MGMT_STATUS_LUN_NOT_EXIST;
mcmd->state = SCST_MCMD_STATE_DONE;
- } else if (rc != 0)
+ } else
res = rc;
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|