提交 8f6fc8d4 编写于 作者: Q Quinn Tran 提交者: Nicholas Bellinger

qla2xxx: Fix inadequate lock protection for ABTS.

Normally, ABTS is sent to Target Core as Task MGMT command.
In the case of error, qla2xxx needs to send response, hardware_lock
is required to prevent request queue corruption.

Cc: <stable@vger.kernel.org>
Signed-off-by: NQuinn Tran <quinn.tran@cavium.com>
Signed-off-by: NHimanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
上级 8b666809
...@@ -130,6 +130,9 @@ static void qlt_send_term_imm_notif(struct scsi_qla_host *vha, ...@@ -130,6 +130,9 @@ static void qlt_send_term_imm_notif(struct scsi_qla_host *vha,
static struct fc_port *qlt_create_sess(struct scsi_qla_host *vha, static struct fc_port *qlt_create_sess(struct scsi_qla_host *vha,
fc_port_t *fcport, bool local); fc_port_t *fcport, bool local);
void qlt_unreg_sess(struct fc_port *sess); void qlt_unreg_sess(struct fc_port *sess);
static void qlt_24xx_handle_abts(struct scsi_qla_host *,
struct abts_recv_from_24xx *);
/* /*
* Global Variables * Global Variables
*/ */
...@@ -389,6 +392,8 @@ static bool qlt_24xx_atio_pkt_all_vps(struct scsi_qla_host *vha, ...@@ -389,6 +392,8 @@ static bool qlt_24xx_atio_pkt_all_vps(struct scsi_qla_host *vha,
(struct abts_recv_from_24xx *)atio; (struct abts_recv_from_24xx *)atio;
struct scsi_qla_host *host = qlt_find_host_by_vp_idx(vha, struct scsi_qla_host *host = qlt_find_host_by_vp_idx(vha,
entry->vp_index); entry->vp_index);
unsigned long flags;
if (unlikely(!host)) { if (unlikely(!host)) {
ql_dbg(ql_dbg_tgt, vha, 0xffff, ql_dbg(ql_dbg_tgt, vha, 0xffff,
"qla_target(%d): Response pkt (ABTS_RECV_24XX) " "qla_target(%d): Response pkt (ABTS_RECV_24XX) "
...@@ -396,9 +401,12 @@ static bool qlt_24xx_atio_pkt_all_vps(struct scsi_qla_host *vha, ...@@ -396,9 +401,12 @@ static bool qlt_24xx_atio_pkt_all_vps(struct scsi_qla_host *vha,
vha->vp_idx, entry->vp_index); vha->vp_idx, entry->vp_index);
break; break;
} }
qlt_response_pkt(host, (response_t *)atio); if (!ha_locked)
spin_lock_irqsave(&host->hw->hardware_lock, flags);
qlt_24xx_handle_abts(host, (struct abts_recv_from_24xx *)atio);
if (!ha_locked)
spin_unlock_irqrestore(&host->hw->hardware_lock, flags);
break; break;
} }
/* case PUREX_IOCB_TYPE: ql2xmvasynctoatio */ /* case PUREX_IOCB_TYPE: ql2xmvasynctoatio */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册