Re: [PATCH nf-next-2.6] netfilter: CLUSTERIP: RCU conversion

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

 



Eric Dumazet wrote:
> @@ -121,16 +128,14 @@ clusterip_config_find_get(__be32 clusterip, int entry)
>  {
>  	struct clusterip_config *c;
>  
> -	read_lock_bh(&clusterip_lock);
> +	rcu_read_lock_bh();
>  	c = __clusterip_config_find(clusterip);
> -	if (!c) {
> -		read_unlock_bh(&clusterip_lock);
> -		return NULL;
> +	if (c) {
> +		atomic_inc(&c->refcount);
> +		if (entry)
> +			atomic_inc(&c->entries);
>   

Shouldn't this be using atomic_inc_not_zero() to avoid races with
clusterip_config_entry_put()?

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