Re: [PATCH 2/7] libfc: Fixup disc_mutex handling

2016-09-30 Thread Johannes Thumshirn
On Fri, Sep 30, 2016 at 09:04:09AM +0200, Hannes Reinecke wrote: > 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 entr

[PATCH 2/7] libfc: Fixup disc_mutex handling

2016-09-30 Thread Hannes Reinecke
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; otherwis