netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ipv6: do not hold route table lock when send ndisc probe
@ 2012-08-17  7:11 Cong Wang
  2012-08-17  7:11 ` [PATCH 2/2] ipv6: remove some useless RCU read lock Cong Wang
  2012-08-17 18:54 ` [PATCH 1/2] ipv6: do not hold route table lock when send ndisc probe Debabrata Banerjee
  0 siblings, 2 replies; 11+ messages in thread
From: Cong Wang @ 2012-08-17  7:11 UTC (permalink / raw)
  To: netdev
  Cc: Cong Wang, Banerjee, Debabrata, David S. Miller,
	Hideaki YOSHIFUJI, Patrick McHardy

In rt6_probe(), we call ndisc_send_ns() with root->rwlock,
but this is not necessary, so we can drop it before calling
ndisc_send_ns().

This could probably fix the deadlock reported by Debabrata:
https://lkml.org/lkml/2012/8/16/432

Reported-by: "Banerjee, Debabrata" <dbanerje@akamai.com>
Cc: "Banerjee, Debabrata" <dbanerje@akamai.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
 net/ipv6/route.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 0ddf2d1..7a36df2 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -460,13 +460,18 @@ static void rt6_probe(struct rt6_info *rt)
 	    time_after(jiffies, neigh->updated + rt->rt6i_idev->cnf.rtr_probe_interval)) {
 		struct in6_addr mcaddr;
 		struct in6_addr *target;
+		struct net_device *dev = rt->dst.dev;
+		struct fib6_table *table = rt->rt6i_table;
 
 		neigh->updated = jiffies;
 		read_unlock_bh(&neigh->lock);
+		read_unlock_bh(&table->tb6_lock);
 
 		target = (struct in6_addr *)&neigh->primary_key;
 		addrconf_addr_solict_mult(target, &mcaddr);
-		ndisc_send_ns(rt->dst.dev, NULL, target, &mcaddr, NULL);
+		ndisc_send_ns(dev, NULL, target, &mcaddr, NULL);
+
+		read_lock_bh(&table->tb6_lock);
 	} else {
 		read_unlock_bh(&neigh->lock);
 	}
-- 
1.7.7.6

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

end of thread, other threads:[~2012-08-24 10:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-17  7:11 [PATCH 1/2] ipv6: do not hold route table lock when send ndisc probe Cong Wang
2012-08-17  7:11 ` [PATCH 2/2] ipv6: remove some useless RCU read lock Cong Wang
2012-08-17 18:54 ` [PATCH 1/2] ipv6: do not hold route table lock when send ndisc probe Debabrata Banerjee
2012-08-20 12:15   ` Cong Wang
2012-08-21  3:44   ` Cong Wang
2012-08-22 16:04     ` Banerjee, Debabrata
2012-08-23  9:11       ` Cong Wang
2012-08-23 16:10     ` Eric Dumazet
2012-08-24  9:15       ` Cong Wang
2012-08-24  9:44         ` Eric Dumazet
2012-08-24 10:45           ` Cong Wang

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