Re: [PATCH nf-next] netfilter: conntrack: don't acquire lock during seq_printf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 11, 2016 at 09:14:29PM +0200, Florian Westphal wrote:
> read access doesn't need any lock here.
> 
> Signed-off-by: Florian Westphal <fw@xxxxxxxxx>
> ---
>  net/netfilter/nf_conntrack_proto_sctp.c | 8 +-------
>  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 9578a7c..1d7ab96 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,
>  /* 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;

Don't we need at least READ_ONCE() here?

> -	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)	\
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux