netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remove leftover rcu_read_unlock calls from __mkroute_output
@ 2010-10-08  0:48 Dimitris Michailidis
  2010-10-08  4:47 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Dimitris Michailidis @ 2010-10-08  0:48 UTC (permalink / raw)
  To: eric.dumazet, netdev

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.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
 net/ipv4/route.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 7864d0c..3888f6b 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -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);
-- 
1.5.4


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

* Re: [PATCH] remove leftover rcu_read_unlock calls from __mkroute_output
  2010-10-08  0:48 [PATCH] remove leftover rcu_read_unlock calls from __mkroute_output Dimitris Michailidis
@ 2010-10-08  4:47 ` Eric Dumazet
  2010-10-08 17:51   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2010-10-08  4:47 UTC (permalink / raw)
  To: Dimitris Michailidis; +Cc: netdev

Le jeudi 07 octobre 2010 à 17:48 -0700, Dimitris Michailidis a écrit :
> 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.
> 
> Signed-off-by: Dimitris Michailidis <dm@chelsio.com>

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Thanks Dimitris !



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

* Re: [PATCH] remove leftover rcu_read_unlock calls from __mkroute_output
  2010-10-08  4:47 ` Eric Dumazet
@ 2010-10-08 17:51   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-10-08 17:51 UTC (permalink / raw)
  To: eric.dumazet; +Cc: dm, netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 08 Oct 2010 06:47:58 +0200

> Le jeudi 07 octobre 2010 à 17:48 -0700, Dimitris Michailidis a écrit :
>> 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.
>> 
>> Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
> 
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, thanks everyone.

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

end of thread, other threads:[~2010-10-08 17:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-08  0:48 [PATCH] remove leftover rcu_read_unlock calls from __mkroute_output Dimitris Michailidis
2010-10-08  4:47 ` Eric Dumazet
2010-10-08 17:51   ` 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).