Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[cascardo/linux.git] / drivers / scsi / qla2xxx / tcm_qla2xxx.c
index 9224a06..7ed7bae 100644 (file)
@@ -420,6 +420,12 @@ static void tcm_qla2xxx_set_default_node_attrs(struct se_node_acl *nacl)
 
 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;
 }