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: <50F6B1DC.4030307@linux-ipv6.org>
Date:	Wed, 16 Jan 2013 22:57:48 +0900
From:	YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
To:	Cong Wang <amwang@...hat.com>
CC:	netdev@...r.kernel.org,
	Steffen Klassert <steffen.klassert@...unet.com>,
	Herbert Xu <herbert@...dor.hengli.com.au>,
	"David S. Miller" <davem@...emloft.net>,
	YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
Subject: Re: [Patch net-next 1/2] xfrm: replace rwlock on xfrm_state_afinfo
 with rcu

Cong Wang wrote:
> From: Cong Wang <amwang@...hat.com>
> 
> Similar to commit 418a99ac6ad487dc9c42e6b0e85f941af56330f2
> (Replace rwlock on xfrm_policy_afinfo with rcu), the rwlock
> on xfrm_state_afinfo can be replaced by RCU too.
> 
> Cc: Steffen Klassert <steffen.klassert@...unet.com>
> Cc: Herbert Xu <herbert@...dor.apana.org.au>
> Cc: "David S. Miller" <davem@...emloft.net>
> Signed-off-by: Cong Wang <amwang@...hat.com>
> ---
>  net/xfrm/xfrm_state.c |   33 ++++++++++++++++-----------------
>  1 files changed, 16 insertions(+), 17 deletions(-)
> 
> diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
> index 3459692..f567716 100644
> --- a/net/xfrm/xfrm_state.c
> +++ b/net/xfrm/xfrm_state.c
:
> @@ -173,17 +173,16 @@ static struct xfrm_state_afinfo *xfrm_state_lock_afinfo(unsigned int family)
>  	struct xfrm_state_afinfo *afinfo;
>  	if (unlikely(family >= NPROTO))
>  		return NULL;
> -	write_lock_bh(&xfrm_state_afinfo_lock);
> +	spin_lock_bh(&xfrm_state_afinfo_lock);
>  	afinfo = xfrm_state_afinfo[family];
>  	if (unlikely(!afinfo))
> -		write_unlock_bh(&xfrm_state_afinfo_lock);
> +		spin_unlock_bh(&xfrm_state_afinfo_lock);
>  	return afinfo;
>  }
>  
>  static void xfrm_state_unlock_afinfo(struct xfrm_state_afinfo *afinfo)
> -	__releases(xfrm_state_afinfo_lock)
>  {
> -	write_unlock_bh(&xfrm_state_afinfo_lock);
> +	spin_unlock_bh(&xfrm_state_afinfo_lock);
>  }
>  
>  int xfrm_register_type(const struct xfrm_type *type, unsigned short family)

Why removing __releases() hint?

--yoshfuji

--
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