qla2xxx: Fix qlt_lport_register base_vha callback race
authorNicholas Bellinger <nab@linux-iscsi.org>
Thu, 20 Feb 2014 01:51:25 +0000 (17:51 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 20 Feb 2014 21:01:17 +0000 (13:01 -0800)
commitddb95145a38eb37b236d4e00f43a75d067922dda
tree81a67c0febfeae8f71e8ca06e21dbb6f6aea9aa3
parentd6a65fdc8903e632aa7bf86ee0f61a73969371f6
qla2xxx: Fix qlt_lport_register base_vha callback race

This patch closes a race between qlt_lport_register() and
tcm_qla2xxx callback logic by holding qla_tgt_mutex before
making the callback.

In order for this to work, the qlt_add_target() and
qlt_remove_target() code has been changed to avoid the
accessing qla_tgt_mutex + list_[add,del] for NPIV enabled
ports.

This bug introduced in v3.14-rc1 code with commit 49a47f2.

Cc: Sawan Chandak <sawan.chandak@qlogic.com>
Cc: Quinn Tran <quinn.tran@qlogic.com>
Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/scsi/qla2xxx/qla_target.c