]> git.openfabrics.org - ~shefty/rdma-dev.git/commit
qla2xxx: Update target lookup session tables when a target session changes
authorRoland Dreier <roland@purestorage.com>
Thu, 11 Oct 2012 20:41:32 +0000 (13:41 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 26 Oct 2012 19:29:46 +0000 (12:29 -0700)
commitc8292d1da53fa60c7516ab03a9d83f7ea266d335
tree0d325d1acb4b807d724ee66b7f4a1998c7f85ef5
parentc046aa0f0f47719a38854fc6383216392b130704
qla2xxx: Update target lookup session tables when a target session changes

It is possible for the target code to change the loop_id or s_id of a
target session in reaction to an FC fabric change.  However, the
session structures are stored in tables that are indexed by these two
keys, and if we just change the session structure but leave the
pointers to it in the old places in the table, havoc can ensue.  For
example, a new session might come along that should go in the old slot
in the table and overwrite the old session pointer.

To handle this, add a new tgt_ops->update_sess() method that also
updates the "by loop_id" and "by s_id" lookup tables when a session
changes, so that the keys where a session pointer is stored in these
tables always matches the keys in the session structure itself.

(nab: Drop unnecessary double inversion with FCF_CONF_COMP_SUPPORTED
      usage)

Signed-off-by: Roland Dreier <roland@purestorage.com>
Cc: Chad Dupuis <chad.dupuis@qlogic.com>
Cc: Arun Easi <arun.easi@qlogic.com>
Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/scsi/qla2xxx/qla_target.c
drivers/scsi/qla2xxx/qla_target.h
drivers/scsi/qla2xxx/tcm_qla2xxx.c