aboutsummaryrefslogtreecommitdiff
path: root/net/ipv4/ip_fragment.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2014-07-24 16:50:36 +0200
committerAlex Shi <alex.shi@linaro.org>2015-12-01 15:01:20 +0800
commit31b36090a9807196f6885b8ed2c39a6ab31d23f5 (patch)
treec42be4eff2d1b9bd28939f3073317953381337ad /net/ipv4/ip_fragment.c
parent1af41b58c2d3572206912ac0becd4197b62de419 (diff)
rehash is rare operation, don't force readers to take the read-side rwlock. Instead, we only have to detect the (rare) case where the secret was altered while we are trying to insert a new inetfrag queue into the table. If it was changed, drop the bucket lock and recompute the hash to get the 'new' chain bucket that we have to insert into. Joint work with Nikolay Aleksandrov. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit ab1c724f633080ed2e8a0cfe61654599b55cf8f9) Signed-off-by: Alex Shi <alex.shi@linaro.org> Conflicts: net/ipv6/netfilter/nf_conntrack_reasm.c net/ipv6/reassembly.c
Diffstat (limited to 'net/ipv4/ip_fragment.c')
-rw-r--r--net/ipv4/ip_fragment.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index dd223e148723..0b91b7b6b95a 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -242,7 +242,6 @@ static inline struct ipq *ip_find(struct net *net, struct iphdr *iph, u32 user)
arg.iph = iph;
arg.user = user;
- read_lock(&ip4_frags.lock);
hash = ipqhashfn(iph->id, iph->saddr, iph->daddr, iph->protocol);
q = inet_frag_find(&net->ipv4.frags, &ip4_frags, &arg, hash);