All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Netfilter Development Mailinglist <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH nf-next-2.6] netfilter: CLUSTERIP: RCU conversion
Date: Wed, 09 Jun 2010 18:30:46 +0200	[thread overview]
Message-ID: <4C0FC1B6.2050605@trash.net> (raw)
In-Reply-To: <1276099861.2442.199.camel@edumazet-laptop>

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()?


  reply	other threads:[~2010-06-09 16:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-09 16:11 [PATCH nf-next-2.6] netfilter: CLUSTERIP: RCU conversion Eric Dumazet
2010-06-09 16:30 ` Patrick McHardy [this message]
2010-06-09 17:11   ` Eric Dumazet
2010-06-14 16:29     ` Patrick McHardy
2010-06-14 19:59       ` Eric Dumazet
2010-06-15 11:10         ` Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C0FC1B6.2050605@trash.net \
    --to=kaber@trash.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.