]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: scsi_transport_fc: Also check for NOTPRESENT in fc_remote_port_add()
authorHannes Reinecke <hare@suse.de>
Mon, 25 Sep 2017 11:47:23 +0000 (13:47 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 26 Sep 2017 01:34:09 +0000 (21:34 -0400)
commitea29c7c6ec15260dea22746a9c0721b1889acecc
tree41b1c42cf87d135bb2a1ce1ea1d043fc53ac0cc4
parent99b78a60054a68ab7dedc47db039bc5637fe0fff
scsi: scsi_transport_fc: Also check for NOTPRESENT in fc_remote_port_add()

During failover there is a small race window between fc_remote_port_add()
and fc_timeout_deleted_rport(); the latter drops the lock after setting the
port to NOTPRESENT, so if fc_remote_port_add() is called right at that time
it will fail to detect the existing rport and happily adding a new
structure, causing rports to get registered twice.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_transport_fc.c