FAILED: patch "[PATCH] qla2xxx: drop cmds/tmrs arrived while session is being" failed to apply to 4.1-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
e52a8b45b9c782937f74b701f8c656d4e5619eb5Mon Sep 17 00:00:00 2001
From: Alexei Potashnik <[email protected]>
Date: Tue, 14 Jul 2015 16:00:48 -0400
Subject: [PATCH] qla2xxx: drop cmds/tmrs arrived while session is being
deleted
If a new initiator (different WWN) shows up on the same fcport, old initiator's session is scheduled for deletion. But there is a small window between it being marked with QLA_SESS_DELETION_IN_PROGRESS and qlt_unret_sess getting called when new session's commands will keep finding old session in the fcport map.
This patch drops cmds/tmrs if they find session in the progress of being deleted.
drivers/scsi/qla2xxx/qla_target.c +28 -0
@@ -1477,6 +1477,11 @@ static void qlt_24xx_handle_abts(struct scsi_qla_host *vha,return ; } +if (sess->deleted ==QLA_SESS_DELETION_IN_PROGRESS ) { +qlt_24xx_send_abts_resp (vha, abts,FCP_TMF_REJECTED , false); +return ; + } + rc =__qlt_24xx_handle_abts (vha, abts, sess);if (rc !=0 ) { ql_dbg(ql_dbg_tgt_mgt, vha, 0xf054,
@@ -3768,6 +3773,16 @@ static int qlt_handle_cmd_for_atio(struct scsi_qla_host *vha,queue_work (qla_tgt_wq, &op->work);return 0 ; } + +/* Another WWN used to have our s_id. Our PLOGI scheduled its +* session deletion, but it's still in sess_del_work wq */ +if (sess->deleted ==QLA_SESS_DELETION_IN_PROGRESS ) { +ql_dbg (ql_dbg_io, vha,0x3061 , +"New command while old session %p is being deleted\n" , + sess); +return -EFAULT ; + } +/* * Do kref_get() before returning + dropping qla_hw_data->hardware_lock. */
@@ -3931,6 +3946,9 @@ static int qlt_handle_task_mgmt(struct scsi_qla_host *vha, void *iocb) sizeof(struct atio_from_isp)); } +if (sess->deleted ==QLA_SESS_DELETION_IN_PROGRESS ) +return -EFAULT ; +return qlt_issue_task_mgmt (sess, unpacked_lun, fn, iocb,0 ); }
@@ -5603,6 +5621,11 @@ static void qlt_abort_work(struct qla_tgt *tgt,if (!sess) goto out_term; }else { +if (sess->deleted ==QLA_SESS_DELETION_IN_PROGRESS ) { + sess =NULL ; + goto out_term; + } +kref_get (&sess->se_sess->sess_kref); }
@@ -5657,6 +5680,11 @@ static void qlt_tmr_work(struct qla_tgt *tgt,if (!sess) goto out_term; }else { +if (sess->deleted ==QLA_SESS_DELETION_IN_PROGRESS ) { + sess =NULL ; + goto out_term; + } +kref_get (&sess->se_sess->sess_kref); }