* [PATCH][INET 1/2]: Drop the inet_inherit_port() call.
@ 2008-04-17 15:59 Pavel Emelyanov
2008-04-18 6:17 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2008-04-17 15:59 UTC (permalink / raw)
To: David Miller; +Cc: Linux Netdev List, Arnaldo Carvalho de Melo
As I can see from the code, two places (tcp_v6_syn_recv_sock and
dccp_v6_request_recv_sock) that call this one already run with
BHs disabled, so it's safe to call __inet_inherit_port there.
Besides (in case I missed smth with code review) the calltrace
tcp_v6_syn_recv_sock
`- tcp_v4_syn_recv_sock
`- __inet_inherit_port
and the similar for DCCP are valid, but assumes BHs to be disabled.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
include/net/inet_hashtables.h | 7 -------
net/dccp/ipv6.c | 2 +-
net/ipv6/tcp_ipv6.c | 2 +-
3 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 5525227..5ec91d8 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -235,13 +235,6 @@ static inline void __inet_inherit_port(struct sock *sk, struct sock *child)
spin_unlock(&head->lock);
}
-static inline void inet_inherit_port(struct sock *sk, struct sock *child)
-{
- local_bh_disable();
- __inet_inherit_port(sk, child);
- local_bh_enable();
-}
-
extern void inet_put_port(struct sock *sk);
extern void inet_listen_wlock(struct inet_hashinfo *hashinfo);
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index f8371c7..9b1129b 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -625,7 +625,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
newinet->daddr = newinet->saddr = newinet->rcv_saddr = LOOPBACK4_IPV6;
__inet6_hash(newsk);
- inet_inherit_port(sk, newsk);
+ __inet_inherit_port(sk, newsk);
return newsk;
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 231c4dd..715965f 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1534,7 +1534,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
#endif
__inet6_hash(newsk);
- inet_inherit_port(sk, newsk);
+ __inet_inherit_port(sk, newsk);
return newsk;
--
1.5.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][INET 1/2]: Drop the inet_inherit_port() call.
2008-04-17 15:59 [PATCH][INET 1/2]: Drop the inet_inherit_port() call Pavel Emelyanov
@ 2008-04-18 6:17 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-04-18 6:17 UTC (permalink / raw)
To: xemul; +Cc: netdev, acme
From: Pavel Emelyanov <xemul@openvz.org>
Date: Thu, 17 Apr 2008 19:59:38 +0400
> As I can see from the code, two places (tcp_v6_syn_recv_sock and
> dccp_v6_request_recv_sock) that call this one already run with
> BHs disabled, so it's safe to call __inet_inherit_port there.
>
> Besides (in case I missed smth with code review) the calltrace
> tcp_v6_syn_recv_sock
> `- tcp_v4_syn_recv_sock
> `- __inet_inherit_port
> and the similar for DCCP are valid, but assumes BHs to be disabled.
>
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
I agree with you analysis, all of these sites have BH disabled,
patch applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-18 6:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-17 15:59 [PATCH][INET 1/2]: Drop the inet_inherit_port() call Pavel Emelyanov
2008-04-18 6:17 ` 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).