lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1417571879.5303.83.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Tue, 02 Dec 2014 17:57:59 -0800
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Duan Jiong <duanj.fnst@...fujitsu.com>
Cc:	David Miller <davem@...emloft.net>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] ipv6: remove useless spin_lock/spin_unlock

On Wed, 2014-12-03 at 09:32 +0800, Duan Jiong wrote:
> xchg is atomic, so there is no necessary to use spin_lock/spin_unlock
> to protect it.
> 
> Signed-off-by: Duan Jiong <duanj.fnst@...fujitsu.com>
> ---
>  net/ipv6/ipv6_sockglue.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
> index e1a9583..92ca907 100644
> --- a/net/ipv6/ipv6_sockglue.c
> +++ b/net/ipv6/ipv6_sockglue.c
> @@ -112,9 +112,7 @@ struct ipv6_txoptions *ipv6_update_options(struct sock *sk,
>  		}
>  		opt = xchg(&inet6_sk(sk)->opt, opt);
>  	} else {
> -		spin_lock(&sk->sk_dst_lock);
>  		opt = xchg(&inet6_sk(sk)->opt, opt);
> -		spin_unlock(&sk->sk_dst_lock);
>  	}
>  	sk_dst_reset(sk);
>  

Why keeping 2 copies of opt = xchg(&inet6_sk(sk)->opt, opt); then ?



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ