Skip to contentSkip to conversation

ipv4: remove nested rcu_read_lock/unlock

PATCH Applied Duan Jiong 3 participants 3 messages Aug 1, 2014 – Aug 2, 2014

Subsystems (3)
lore
Share & tools
lore

Duan Jiong

author
#0 lore raw

PATCH 1/1 ipv4: remove nested rcu_read_lock/unlock

ip_local_deliver_finish() already have a rcu_read_lock/unlock, so the rcu_read_lock/unlock is unnecessary.

See the stack below:
ip_local_deliver_finish

	|
	|
	->icmp_rcv
		|
		|
		->icmp_socket_deliver
---
 net/ipv4/icmp.c | 2 --
 1 file changed, 2 deletions(-)
net/ipv4/icmp.c +0 -2
index 092400e..ea7d4af 100644
@@ -670,11 +670,9 @@ static void icmp_socket_deliver(struct sk_buff *skb, u32 info)
 
 	raw_icmp_error(skb, protocol, info);
 
-	rcu_read_lock();
 	ipprot = rcu_dereference(inet_protos[protocol]);
 	if (ipprot && ipprot->err_handler)
 		ipprot->err_handler(skb, info);
-	rcu_read_unlock();
 }
 
 static bool icmp_tag_validation(int proto)
Signature · 1 line
1.8.3.1
maintainer Applied
#2 lore raw
In reply to Duan Jiong

From: Duan Jiong <[email protected]>
Date: Fri, 1 Aug 2014 14:00:36 +0800

Quoted 13 lines

ip_local_deliver_finish() already have a rcu_read_lock/unlock, so the rcu_read_lock/unlock is unnecessary.

See the stack below:
ip_local_deliver_finish

	|
	|
	->icmp_rcv
		|
		|
		->icmp_socket_deliver
Quoted 2 lines

Applied, thank you.