All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <ordex@autistici.org>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCHv9 2/3] batman-adv: add sysfs framework for VLAN
Date: Wed, 26 Jun 2013 23:05:22 +0200	[thread overview]
Message-ID: <20130626210522.GG2120@ritirata.org> (raw)
In-Reply-To: <201306270500.04863.lindner_marek@yahoo.de>

[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]

On Thu, Jun 27, 2013 at 05:00:04AM +0800, Marek Lindner wrote:
> On Thursday, June 27, 2013 01:02:06 Antonio Quartulli wrote:
> > +static struct batadv_softif_vlan *
> > +batadv_kobj_to_vlan(struct batadv_priv *bat_priv, struct kobject *obj)
> > +{
> > +       struct batadv_softif_vlan *vlan;
> > +
> > +       hlist_for_each_entry_rcu(vlan, &bat_priv->softif_vlan_list, list) {
> > +               if (vlan->kobj != obj)
> > +                       continue;
> > +
> > +               if (!atomic_inc_not_zero(&vlan->refcount))
> > +                       continue;
> > +
> > +               return vlan;
> > +       }
> > +
> > +       return NULL;
> > +}
> 
> Aren't we missing a rcu_lock()/rcu_unlock() combo ?

I was unsure of this because of the context where this for_each is executed.
But I think there is nothing protecting the RCU..so yes, we need
rcu_read_lock/unlock.


> 
> Cheers,
> Marek

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-06-26 21:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26 17:02 [B.A.T.M.A.N.] [PATCHv9 0/3] TT-VLAN: First patchset Antonio Quartulli
2013-06-26 17:02 ` [B.A.T.M.A.N.] [PATCHv9 1/3] batman-adv: add per VLAN interface attribute framework Antonio Quartulli
2013-06-26 17:02 ` [B.A.T.M.A.N.] [PATCHv9 2/3] batman-adv: add sysfs framework for VLAN Antonio Quartulli
2013-06-26 21:00   ` Marek Lindner
2013-06-26 21:05     ` Antonio Quartulli [this message]
2013-06-26 17:02 ` [B.A.T.M.A.N.] [PATCHv9 3/3] batman-adv: make the AP isolation attribute VLAN specific Antonio Quartulli

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=20130626210522.GG2120@ritirata.org \
    --to=ordex@autistici.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.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.