Skip to content

Commit 863555b

Browse files
mdrustadNicholas Bellinger
authored andcommitted
tcm_fc: Resolve suspicious RCU usage warnings
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 <[email protected]> Tested-by: Ross Brattain <[email protected]> Cc: <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent 5134de2 commit 863555b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/target/tcm_fc/tfc_sess.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ static struct ft_tport *ft_tport_create(struct fc_lport *lport)
5858
struct ft_tport *tport;
5959
int i;
6060

61-
tport = rcu_dereference(lport->prov[FC_TYPE_FCP]);
61+
tport = rcu_dereference_protected(lport->prov[FC_TYPE_FCP],
62+
lockdep_is_held(&ft_lport_lock));
6263
if (tport && tport->tpg)
6364
return tport;
6465

0 commit comments

Comments
 (0)