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

Commit f4c24db1 authored by Joern Engel's avatar Joern Engel Committed by Nicholas Bellinger
Browse files

qla_target: don't delete changed nacls



The code is currently riddled with "drop the hardware_lock to avoid a
deadlock" bugs that expose races.  One of those races seems to expose a
valid warning in tcm_qla2xxx_clear_nacl_from_fcport_map.  Add some
bandaid to it.

Signed-off-by: default avatarJoern Engel <joern@logfs.org>
Cc: <stable@vger.kernel.org> # v3.5+
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent f56574a2
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -757,7 +757,16 @@ static void tcm_qla2xxx_clear_nacl_from_fcport_map(struct qla_tgt_sess *sess)
	pr_debug("fc_rport domain: port_id 0x%06x\n", nacl->nport_id);

	node = btree_remove32(&lport->lport_fcport_map, nacl->nport_id);
	WARN_ON(node && (node != se_nacl));
	if (WARN_ON(node && (node != se_nacl))) {
		/*
		 * The nacl no longer matches what we think it should be.
		 * Most likely a new dynamic acl has been added while
		 * someone dropped the hardware lock.  It clearly is a
		 * bug elsewhere, but this bit can't make things worse.
		 */
		btree_insert32(&lport->lport_fcport_map, nacl->nport_id,
			       node, GFP_ATOMIC);
	}

	pr_debug("Removed from fcport_map: %p for WWNN: 0x%016LX, port_id: 0x%06x\n",
	    se_nacl, nacl->nport_wwnn, nacl->nport_id);