From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: orig_hash_find() manages rcu_lock/unlock internally
Date: Sat, 16 Apr 2011 10:02:43 +0200 [thread overview]
Message-ID: <201104161002.44105.sven@narfation.org> (raw)
In-Reply-To: <1302891416-31451-1-git-send-email-ordex@autistici.org>
[-- Attachment #1: Type: Text/Plain, Size: 1497 bytes --]
Antonio Quartulli wrote:
> orig_hash_find() manages rcu_lock/unlock internally and doesn't need to
> be surrounded by rcu_read_lock() / rcu_read_unlock() anymore
>
> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Valid point, but incorrect implementation
> ---
> routing.c | 6 ------
> 1 files changed, 0 insertions(+), 6 deletions(-)
>
> diff --git a/routing.c b/routing.c
> index f6c6422..634a44d 100644
> --- a/routing.c
> +++ b/routing.c
> @@ -1310,14 +1310,11 @@ int route_unicast_packet(struct sk_buff *skb,
> struct hard_iface *recv_if) }
>
> /* get routing information */
> - rcu_read_lock();
> orig_node = orig_hash_find(bat_priv, unicast_packet->dest);
>
> if (!orig_node)
> goto unlock;
>
> - rcu_read_unlock();
> -
You forgot to fix the rcu_read_unlock after the label unlock.
> /* find_router() increases neigh_nodes refcount if found. */
> neigh_node = find_router(bat_priv, orig_node, recv_if);
>
> @@ -1464,14 +1461,11 @@ int recv_bcast_packet(struct sk_buff *skb, struct
> hard_iface *recv_if) if (bcast_packet->ttl < 2)
> goto out;
>
> - rcu_read_lock();
> orig_node = orig_hash_find(bat_priv, bcast_packet->orig);
>
> if (!orig_node)
> goto rcu_unlock;
>
> - rcu_read_unlock();
> -
> spin_lock_bh(&orig_node->bcast_seqno_lock);
>
> /* check whether the packet is a duplicate */
You forgot to fix the rcu_read_unlock after the label rcu_unlock.
Kind regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2011-04-16 8:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-15 18:16 [B.A.T.M.A.N.] [PATCH] batman-adv: orig_hash_find() manages rcu_lock/unlock internally Antonio Quartulli
2011-04-16 8:02 ` Sven Eckelmann [this message]
2011-04-16 9:30 ` [B.A.T.M.A.N.] [PATCHv3] " Antonio Quartulli
2011-04-18 15:05 ` Marek Lindner
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=201104161002.44105.sven@narfation.org \
--to=sven@narfation.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.