]> www.infradead.org Git - users/jedix/linux-maple.git/commit
scsi: libfc: Fixup disc_mutex handling
authorHannes Reinecke <hare@suse.de>
Fri, 30 Sep 2016 09:01:15 +0000 (11:01 +0200)
committerBrian Maly <brian.maly@oracle.com>
Sun, 12 May 2019 01:51:44 +0000 (21:51 -0400)
commit6f58c151fbd8fd3152fb3072eef45367963140ef
tree0e2f0ee66ebced83fdccbadd6a2fa33e4116bd89
parentb46ec5bb492dedcd6798ab9c9fd43f2fd3373b08
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.

Orabug: 25933179

Reviewed-by: John Sobecki <john.sobecki@oracle.com>
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>
Signed-off-by: Rajan Shanmugavelu <rajan.shanmugavelu@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/scsi/libfc/fc_rport.c