diff options
author | Jörn Engel <joern@logfs.org> | 2013-06-12 16:27:54 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-06-20 14:10:48 -0700 |
commit | 08234e3adc7a299c9213bcfa0b5e97c359129670 (patch) | |
tree | 0caae34a966145ca746550421ae50909c1a23c24 /drivers/scsi/qla2xxx/tcm_qla2xxx.c | |
parent | 084ed45b3846ffb803a6cd6d631c1723e77689e0 (diff) | |
download | linux-next-08234e3adc7a299c9213bcfa0b5e97c359129670.tar.gz |
qla_target: remove qlt_check_fcport_exist
Comment from original 2012 patch:
In all our testing this function has never returned true. However, the
dropping of hardware_lock necessary to call this function seems to cause
a use-after-free we manage to hit rather frequently. Given this
cost-benefit ratio, I'm willing to remove some 100 lines of code.
And since the same problem exists around shutdown_sess and put_sess,
this patch changes them from taking the hardware_lock to requiring the
hardware_lock to be taken. In most cases the caller already had the
lock and had to drop it for the called method to reacquire it. At best
that hurts performance and in rare instances it causes races with fatal
consequences.
We dropped the original 2012 patch when upgrading our kernel and it took
us nearly half a year to discover we still need it.
(nab: Fix qla_tgt_sess reference in tcm_qla2xxx_put_sess)
Signed-off-by: Joern Engel <joern@logfs.org>
Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
Cc: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/scsi/qla2xxx/tcm_qla2xxx.c')
-rw-r--r-- | drivers/scsi/qla2xxx/tcm_qla2xxx.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 7a3870f385f6..bb7eb909f0b1 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -795,12 +795,14 @@ static void tcm_qla2xxx_put_session(struct se_session *se_sess) static void tcm_qla2xxx_put_sess(struct qla_tgt_sess *sess) { - tcm_qla2xxx_put_session(sess->se_sess); + assert_spin_locked(&sess->vha->hw->hardware_lock); + kref_put(&sess->se_sess->sess_kref, tcm_qla2xxx_release_session); } static void tcm_qla2xxx_shutdown_sess(struct qla_tgt_sess *sess) { - tcm_qla2xxx_shutdown_session(sess->se_sess); + assert_spin_locked(&sess->vha->hw->hardware_lock); + target_sess_cmd_list_set_waiting(sess->se_sess); } static struct se_node_acl *tcm_qla2xxx_make_nodeacl( |