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)
committerSasha Levin <sasha.levin@oracle.com>
Tue, 23 Feb 2016 15:05:08 +0000 (10:05 -0500)
commiteaaecc5e28b49dc00c4c36f1f5fd1acf1f4f4be1
tree7709aa0f4dc3da472eb9c5b370e2e6c10e1a0069
parent1226aefc12eef8b339bdaff0bfe11d72eb4978df
qla2xxx: added sess generations to detect RSCN update races

[ Upstream commit df673274fa4896f25f0bf348d2a3535d74b4cbec ]

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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
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