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: 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.] [PATCH maint] batman-adv: Reduce refcnt of removed router when updating route
Date: Sun, 20 Mar 2016 18:45:29 +0800	[thread overview]
Message-ID: <9014983.RsdMSR9Elr@voltaire> (raw)
In-Reply-To: <1457189627-8839-1-git-send-email-sven@narfation.org>

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

On Saturday, March 05, 2016 15:53:47 Sven Eckelmann wrote:
> --- a/net/batman-adv/routing.c
> +++ b/net/batman-adv/routing.c
> @@ -104,6 +104,8 @@ static void _batadv_update_route(struct batadv_priv
> *bat_priv, neigh_node = NULL;
>  
>         spin_lock_bh(&orig_node->neigh_list_lock);
> +       curr_router = rcu_dereference_protected(orig_ifinfo->router, true);
> +
>         rcu_assign_pointer(orig_ifinfo->router, neigh_node);
>         spin_unlock_bh(&orig_node->neigh_list_lock);
>         batadv_orig_ifinfo_free_ref(orig_ifinfo);

Don't we also need to check for curr_router->refcount > 0 to mimic the check 
above ? Maybe a negative refcount does not hurt or is it unsigned ?

Cheers,
Marek

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

  reply	other threads:[~2016-03-20 10:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-05 14:53 [B.A.T.M.A.N.] [PATCH maint] batman-adv: Reduce refcnt of removed router when updating route Sven Eckelmann
2016-03-20 10:45 ` Marek Lindner [this message]
2016-03-20 11:01   ` Sven Eckelmann

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=9014983.RsdMSR9Elr@voltaire \
    --to=mareklindner@neomailbox.ch \
    --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