Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1e261d4 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen
Browse files

scsi: qla2xxx: Complain if a command is released that is owned by the firmware



The previous patch guarantees that a command is only released after the
firmware has finished processing it. Hence complain if a command is
released that is owned by the firmware.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Giridhar Malavali <gmalavali@marvell.com>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Acked-by: default avatarHimanshu Madhani <hmadhani@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent aefed3e5
Loading
Loading
Loading
Loading
+4 −9
Original line number Original line Diff line number Diff line
@@ -320,7 +320,6 @@ static int tcm_qla2xxx_check_stop_free(struct se_cmd *se_cmd)
static void tcm_qla2xxx_release_cmd(struct se_cmd *se_cmd)
static void tcm_qla2xxx_release_cmd(struct se_cmd *se_cmd)
{
{
	struct qla_tgt_cmd *cmd;
	struct qla_tgt_cmd *cmd;
	unsigned long flags;


	if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) {
	if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) {
		struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd,
		struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd,
@@ -330,15 +329,11 @@ static void tcm_qla2xxx_release_cmd(struct se_cmd *se_cmd)
	}
	}
	cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd);
	cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd);


	spin_lock_irqsave(&cmd->cmd_lock, flags);
	if (WARN_ON(cmd->cmd_sent_to_fw))
	if (cmd->cmd_sent_to_fw) {
		return;
		cmd->released = 1;

		spin_unlock_irqrestore(&cmd->cmd_lock, flags);
	} else {
		spin_unlock_irqrestore(&cmd->cmd_lock, flags);
	qlt_free_cmd(cmd);
	qlt_free_cmd(cmd);
}
}
}


static void tcm_qla2xxx_release_session(struct kref *kref)
static void tcm_qla2xxx_release_session(struct kref *kref)
{
{