Patch from Gal Rosen <galr@storwize.com>:

I suggest the attached patch for the issue of disabling target mode
while I/O.

Fix BUG in qla target. Set ha->tgt to NULL in wrong place (when
disabling target mode). This cause to unfinished commands, and the echo
command to disabling the target mode to stuck. scst_tgt_cmd_done never
called because the ha->tgt was set to NULL before it should be. ha->tgt
already set to NULL in q2t_target_release after all task managements
finished and all commands were cleaned, so the fix just remove the set
from q2t_host_action.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@984 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2009-07-28 09:29:12 +00:00
parent 833d111501
commit aac4e05c23

View File

@@ -2195,7 +2195,6 @@ static void q2t_host_action(scsi_qla_host_t *ha,
}
tgt = ha->tgt;
ha->tgt = NULL; /* ensure no one gets in behind us */
spin_unlock_irqrestore(&ha->hardware_lock, flags);
mutex_unlock(&qla_mgmt_mutex);
@@ -2205,7 +2204,8 @@ static void q2t_host_action(scsi_qla_host_t *ha,
scst_unregister(tgt->scst_tgt);
/*
* Free of tgt happens via callback q2t_target_release
* called from scst_unregister, so we shouldn't touch it again
* called from scst_unregister, so it might be dead here!
* Let's clear it just in case.
*/
tgt = NULL;
break;