Skip to contentSkip to conversation

remove leftover rcu_read_unlock calls from __mkroute_output

PATCH Applied Dimitris Michailidis 3 participants 3 messages Oct 8, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove leftover rcu_read_unlock calls from __mkroute_output

Commit "fib: RCU conversion of fib_lookup()" removed rcu_read_lock() from __mkroute_output but left a couple of calls to rcu_read_unlock() in there. This causes lockdep to complain that the rcu_read_unlock() call in __ip_route_output_key causes a lock inbalance and quickly crashes the kernel. The below fixes this for me.

---
 net/ipv4/route.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
net/ipv4/route.c +2 -4
index 7864d0c..3888f6b 100644
@@ -2396,12 +2396,10 @@ static int __mkroute_output(struct rtable **result,
 
 
 	rth = dst_alloc(&ipv4_dst_ops);
-	if (!rth) {
-		rcu_read_unlock();
+	if (!rth)
 		return -ENOBUFS;
-	}
+
 	in_dev_hold(in_dev);
-	rcu_read_unlock();
 	rth->idev = in_dev;
 
 	atomic_set(&rth->dst.__refcnt, 1);
Signature · 1 line
1.5.4
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Dimitris Michailidis

Commit "fib: RCU conversion of fib_lookup()" removed rcu_read_lock() from __mkroute_output but left a couple of calls to rcu_read_unlock() in there. This causes lockdep to complain that the rcu_read_unlock() call in __ip_route_output_key causes a lock inbalance and quickly crashes the kernel. The below fixes this for me.

Thanks Dimitris !

maintainer Applied
#2 lore raw

From: Eric Dumazet <[email protected]>
Date: Fri, 08 Oct 2010 06:47:58 +0200

Quoted 10 lines · Dimitris Michailidis
Quoted 7 lines

Commit "fib: RCU conversion of fib_lookup()" removed rcu_read_lock() from __mkroute_output but left a couple of calls to rcu_read_unlock() in there. This causes lockdep to complain that the rcu_read_unlock() call in __ip_route_output_key causes a lock inbalance and quickly crashes the kernel. The below fixes this for me.

Applied, thanks everyone.