netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net-next] ipv6: fix a RCU warning in net/ipv6/ip6_flowlabel.c
@ 2013-02-08  1:52 Cong Wang
  2013-02-08 22:57 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Cong Wang @ 2013-02-08  1:52 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, YOSHIFUJI Hideaki, Cong Wang

This patch fixes the following RCU warning:

[   51.680236] ===============================
[   51.681914] [ INFO: suspicious RCU usage. ]
[   51.683610] 3.8.0-rc6-next-20130206-sasha-00028-g83214f7-dirty #276 Tainted: G        W
[   51.686703] -------------------------------
[   51.688281] net/ipv6/ip6_flowlabel.c:671 suspicious rcu_dereference_check() usage!

we should use rcu_dereference_bh() when we hold rcu_read_lock_bh().

Reported-by: Sasha Levin <sasha.levin@oracle.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Cong Wang <amwang@redhat.com>

---
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index ea42bf4..a7da2f4 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -65,13 +65,13 @@ static DEFINE_SPINLOCK(ip6_fl_lock);
 static DEFINE_SPINLOCK(ip6_sk_fl_lock);
 
 #define for_each_fl_rcu(hash, fl)				\
-	for (fl = rcu_dereference(fl_ht[(hash)]);		\
+	for (fl = rcu_dereference_bh(fl_ht[(hash)]);		\
 	     fl != NULL;					\
-	     fl = rcu_dereference(fl->next))
+	     fl = rcu_dereference_bh(fl->next))
 #define for_each_fl_continue_rcu(fl)				\
-	for (fl = rcu_dereference(fl->next);			\
+	for (fl = rcu_dereference_bh(fl->next);			\
 	     fl != NULL;					\
-	     fl = rcu_dereference(fl->next))
+	     fl = rcu_dereference_bh(fl->next))
 
 #define for_each_sk_fl_rcu(np, sfl)				\
 	for (sfl = rcu_dereference_bh(np->ipv6_fl_list);	\

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch net-next] ipv6: fix a RCU warning in net/ipv6/ip6_flowlabel.c
  2013-02-08  1:52 [Patch net-next] ipv6: fix a RCU warning in net/ipv6/ip6_flowlabel.c Cong Wang
@ 2013-02-08 22:57 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-02-08 22:57 UTC (permalink / raw)
  To: amwang; +Cc: netdev, yoshfuji

From: Cong Wang <amwang@redhat.com>
Date: Fri,  8 Feb 2013 09:52:40 +0800

> This patch fixes the following RCU warning:
> 
> [   51.680236] ===============================
> [   51.681914] [ INFO: suspicious RCU usage. ]
> [   51.683610] 3.8.0-rc6-next-20130206-sasha-00028-g83214f7-dirty #276 Tainted: G        W
> [   51.686703] -------------------------------
> [   51.688281] net/ipv6/ip6_flowlabel.c:671 suspicious rcu_dereference_check() usage!
> 
> we should use rcu_dereference_bh() when we hold rcu_read_lock_bh().
> 
> Reported-by: Sasha Levin <sasha.levin@oracle.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> Signed-off-by: Cong Wang <amwang@redhat.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-08 22:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-08  1:52 [Patch net-next] ipv6: fix a RCU warning in net/ipv6/ip6_flowlabel.c Cong Wang
2013-02-08 22:57 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).