diff options
author | Florian Westphal <fw@strlen.de> | 2016-04-11 15:14:29 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-04-19 14:26:25 -0400 |
commit | a163f2cb393d9d71cad57bfe6a8c7f452a478fb4 (patch) | |
tree | 025161410579d29f63ab274dddc6aa16e1e85755 | |
parent | 4a96300cec88729415683db8a2b909563b09fbaa (diff) |
netfilter: conntrack: don't acquire lock during seq_printf
read access doesn't need any lock here.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | net/netfilter/nf_conntrack_proto_sctp.c | 8 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_proto_tcp.c | 8 |
2 files changed, 2 insertions, 14 deletions
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c index 9578a7c371ef..1d7ab960a9e6 100644 --- a/net/netfilter/nf_conntrack_proto_sctp.c +++ b/net/netfilter/nf_conntrack_proto_sctp.c | |||
@@ -191,13 +191,7 @@ static void sctp_print_tuple(struct seq_file *s, | |||
191 | /* Print out the private part of the conntrack. */ | 191 | /* Print out the private part of the conntrack. */ |
192 | static void sctp_print_conntrack(struct seq_file *s, struct nf_conn *ct) | 192 | static void sctp_print_conntrack(struct seq_file *s, struct nf_conn *ct) |
193 | { | 193 | { |
194 | enum sctp_conntrack state; | 194 | seq_printf(s, "%s ", sctp_conntrack_names[ct->proto.sctp.state]); |
195 | |||
196 | spin_lock_bh(&ct->lock); | ||
197 | state = ct->proto.sctp.state; | ||
198 | spin_unlock_bh(&ct->lock); | ||
199 | |||
200 | seq_printf(s, "%s ", sctp_conntrack_names[state]); | ||
201 | } | 195 | } |
202 | 196 | ||
203 | #define for_each_sctp_chunk(skb, sch, _sch, offset, dataoff, count) \ | 197 | #define for_each_sctp_chunk(skb, sch, _sch, offset, dataoff, count) \ |
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c index 278f3b9356ef..e0cb0ce38746 100644 --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c | |||
@@ -313,13 +313,7 @@ static void tcp_print_tuple(struct seq_file *s, | |||
313 | /* Print out the private part of the conntrack. */ | 313 | /* Print out the private part of the conntrack. */ |
314 | static void tcp_print_conntrack(struct seq_file *s, struct nf_conn *ct) | 314 | static void tcp_print_conntrack(struct seq_file *s, struct nf_conn *ct) |
315 | { | 315 | { |
316 | enum tcp_conntrack state; | 316 | seq_printf(s, "%s ", tcp_conntrack_names[ct->proto.tcp.state]); |
317 | |||
318 | spin_lock_bh(&ct->lock); | ||
319 | state = ct->proto.tcp.state; | ||
320 | spin_unlock_bh(&ct->lock); | ||
321 | |||
322 | seq_printf(s, "%s ", tcp_conntrack_names[state]); | ||
323 | } | 317 | } |
324 | 318 | ||
325 | static unsigned int get_conntrack_index(const struct tcphdr *tcph) | 319 | static unsigned int get_conntrack_index(const struct tcphdr *tcph) |