netfilter: conntrack: don't acquire lock during seq_printf
authorFlorian Westphal <fw@strlen.de>
Mon, 11 Apr 2016 19:14:29 +0000 (21:14 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 19 Apr 2016 18:26:25 +0000 (20:26 +0200)
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>
net/netfilter/nf_conntrack_proto_sctp.c
net/netfilter/nf_conntrack_proto_tcp.c

index 9578a7c371ef2ce04f0a7b10c694b2533e29bd3a..1d7ab960a9e64c018d83ba428a8fbd9b00656985 100644 (file)
@@ -191,13 +191,7 @@ static void sctp_print_tuple(struct seq_file *s,
 /* Print out the private part of the conntrack. */
 static void sctp_print_conntrack(struct seq_file *s, struct nf_conn *ct)
 {
-       enum sctp_conntrack state;
-
-       spin_lock_bh(&ct->lock);
-       state = ct->proto.sctp.state;
-       spin_unlock_bh(&ct->lock);
-
-       seq_printf(s, "%s ", sctp_conntrack_names[state]);
+       seq_printf(s, "%s ", sctp_conntrack_names[ct->proto.sctp.state]);
 }
 
 #define for_each_sctp_chunk(skb, sch, _sch, offset, dataoff, count)    \
index 278f3b9356efdcd37ca3d1aacb62f03e57db7e3c..e0cb0ce387462622228f626c3791423d332e2585 100644 (file)
@@ -313,13 +313,7 @@ static void tcp_print_tuple(struct seq_file *s,
 /* Print out the private part of the conntrack. */
 static void tcp_print_conntrack(struct seq_file *s, struct nf_conn *ct)
 {
-       enum tcp_conntrack state;
-
-       spin_lock_bh(&ct->lock);
-       state = ct->proto.tcp.state;
-       spin_unlock_bh(&ct->lock);
-
-       seq_printf(s, "%s ", tcp_conntrack_names[state]);
+       seq_printf(s, "%s ", tcp_conntrack_names[ct->proto.tcp.state]);
 }
 
 static unsigned int get_conntrack_index(const struct tcphdr *tcph)