Skip to content

Commit

Permalink
tcm_fc: Resolve suspicious RCU usage warnings
Browse files Browse the repository at this point in the history
Use rcu_dereference_protected to tell rcu that the ft_lport_lock
is held during ft_lport_create. This resolved "suspicious RCU usage"
warnings when debugging options are turned on.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Mark Rustad authored and Nicholas Bellinger committed Jul 6, 2012
1 parent 5134de2 commit 863555b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/target/tcm_fc/tfc_sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ static struct ft_tport *ft_tport_create(struct fc_lport *lport)
struct ft_tport *tport;
int i;

tport = rcu_dereference(lport->prov[FC_TYPE_FCP]);
tport = rcu_dereference_protected(lport->prov[FC_TYPE_FCP],
lockdep_is_held(&ft_lport_lock));
if (tport && tport->tpg)
return tport;

Expand Down

0 comments on commit 863555b

Please sign in to comment.