Invoking get_cmd_state for qla2xxx always returns 0. Instead change it
to return the actual fabric state from qla_tgt_cmd. This will help with
debugging.
Signed-off-by: Dilip Kumar Uppugandla <dilip@purestorage.com>
Signed-off-by: Spencer Baugh <sbaugh@catern.com>
Acked-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
 
 static int tcm_qla2xxx_get_cmd_state(struct se_cmd *se_cmd)
 {
+       if (!(se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)) {
+               struct qla_tgt_cmd *cmd = container_of(se_cmd,
+                               struct qla_tgt_cmd, se_cmd);
+               return cmd->state;
+       }
+
        return 0;
 }