]> git.baikalelectronics.ru Git - kernel.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)
commit11c73c1fa9437c210958abafc1e5d9436bf5b8b3
tree0d325d1acb4b807d724ee66b7f4a1998c7f85ef5
parente2d0378596776f46d815e2a71a7496b255b6a823
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