public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Marek Lindner <mareklindner@neomailbox.ch>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Antonio Quartulli <a@unstable.cc>
Subject: Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix reference counting of vlan object for tt_local_entry
Date: Thu, 21 Apr 2016 18:40:30 +0800	[thread overview]
Message-ID: <5665150.3O6JYoqodr@voltaire> (raw)
In-Reply-To: <20160421102252.GB23886@prodigo>

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

On Thursday, April 21, 2016 18:22:52 Antonio Quartulli wrote:
> On Fri, Mar 11, 2016 at 04:44:05PM +0100, Sven Eckelmann wrote:
> > The batadv_tt_local_entry was specific to a batadv_softif_vlan and held an
> > implicit reference to it. But this reference was never stored in form of a
> > pointer in the tt_local_entry itself. Instead batadv_tt_local_remove,
> > batadv_tt_local_table_free and batadv_tt_local_purge_pending_clients
> > depend
> > on a consistent state of bat_priv->softif_vlan_list and that
> > batadv_softif_vlan_get always returns the batadv_softif_vlan object which
> > it has a reference for. But batadv_softif_vlan_get cannot guarantee that
> > because it is working only with rcu_read_lock on this list. It can
> > therefore happen that an vid is in this list twice or that
> > batadv_softif_vlan_get cannot find the batadv_softif_vlan for an vid due
> > to
> > some other list operations taking place at the same time.
> >
> > 
> >
> > Instead add a batadv_softif_vlan pointer directly in batadv_tt_local_entry
> > which will be used for the reference counter decremented on release of
> > batadv_tt_local_entry.
> >
> > 
> >
> > Fixes: 9729d2085c0f ("batman-adv: fix TT VLAN inconsistency on VLAN
> > re-add") Signed-off-by: Sven Eckelmann <sven@narfation.org>
> 
> Thanks a lot Sven ! This change, on top of fixing the ref issue, also
> simplified the code quite a lot!
> 
> Acked-by: Antonio Quartulli <a@unstable.cc>

Applied in revision 20ca393.

Thanks,
Marek


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

      reply	other threads:[~2016-04-21 10:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 15:44 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix reference counting of vlan object for tt_local_entry Sven Eckelmann
2016-03-11 15:44 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix reference counting of hardif_neigh_node object for neigh_node Sven Eckelmann
2016-04-21 10:44   ` Marek Lindner
2016-04-21 10:22 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix reference counting of vlan object for tt_local_entry Antonio Quartulli
2016-04-21 10:40   ` Marek Lindner [this message]

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=5665150.3O6JYoqodr@voltaire \
    --to=mareklindner@neomailbox.ch \
    --cc=a@unstable.cc \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox