]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
scsi: libfc: Fixup disc_mutex handling
authorHannes Reinecke <hare@suse.de>
Fri, 30 Sep 2016 09:01:15 +0000 (11:01 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 8 Nov 2016 22:29:46 +0000 (17:29 -0500)
commita407c593398c886db4fa1fc5c6fec55e61187a09
tree5428a0f043492514d1d3c0b6097a511f46967a29
parent4d2095cc42a2d8062590891f929d9d694cbd927f
scsi: libfc: Fixup disc_mutex handling

The list of attached 'rdata' remote port structures is RCU
protected, so there is no need to take the 'disc_mutex' when
traversing it.
Rather we should be using rcu_read_lock() and kref_get_unless_zero()
to validate the entries.
We need, however, take the disc_mutex when deleting an entry;
otherwise we risk clashes with list_add.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Acked-by: Johannes Thumshirn <jth@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/fcoe/fcoe_ctlr.c
drivers/scsi/libfc/fc_disc.c
drivers/scsi/libfc/fc_lport.c
drivers/scsi/libfc/fc_rport.c