Skip to content

Commit

Permalink
tcm_fc: Resolve suspicious RCU usage warnings
Browse files Browse the repository at this point in the history
commit 863555b upstream.

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>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
  • Loading branch information
mdrustad authored and bwhacks committed Jul 12, 2012
1 parent 1935549 commit 90f81e2
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 @@ -61,7 +61,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 90f81e2

Please sign in to comment.