Skip to contentSkip to conversation

ipv6: fix a RCU warning in net/ipv6/ip6_flowlabel.c

PATCH Applied Cong Wang 2 participants 2 messages Feb 8, 2013

Subsystems (4)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 ipv6: fix a RCU warning in net/ipv6/ip6_flowlabel.c

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().

Cc David S. Miller <[email protected]>
Cc YOSHIFUJI Hideaki <[email protected]>

---

net/ipv6/ip6_flowlabel.c +4 -4
index ea42bf4..a7da2f4 100644
@@ -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);	\
maintainer Applied
#1 lore raw

From: Cong Wang <[email protected]>
Date: Fri, 8 Feb 2013 09:52:40 +0800

Quoted 8 lines

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!
Quoted 6 lines

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

Cc David S. Miller <[email protected]>
Cc YOSHIFUJI Hideaki <[email protected]>

Applied.