qla2xxx: added sess generations to detect RSCN update races
authorAlexei Potashnik <alexei@purestorage.com>
Tue, 14 Jul 2015 20:00:46 +0000 (16:00 -0400)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 24 Jul 2015 21:19:41 +0000 (14:19 -0700)
commitdf673274fa4896f25f0bf348d2a3535d74b4cbec
treead159532d4f462624e2051e128a42c3f4f3c4ad9
parentdaddf5cf9b5c68b81b2bb7133f1dd0fda4552d0b
qla2xxx: added sess generations to detect RSCN update races

RSCN processing in qla2xxx driver can run in parallel with ELS/IO
processing. As such the decision to remove disappeared fc port's
session could be stale, because a new login sequence has occurred
since and created a brand new session.

Previous mechanism of dealing with this by delaying deletion request
was prone to erroneous deletions if the event that was supposed to
cancel the deletion never arrived or has been delayed in processing.

New mechanism relies on a time-like generation counter to serialize
RSCN updates relative to ELS/IO updates.

Cc: <stable@vger.kernel.org> # v3.18+
Signed-off-by: Alexei Potashnik <alexei@purestorage.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla2xxx/qla_target.c
drivers/scsi/qla2xxx/qla_target.h