* [PATCH] ipv6: Annotate change of locking mechanism for np->opt
@ 2016-02-18 0:20 Benjamin Poirier
2016-02-18 8:08 ` Eric Dumazet
2016-02-18 20:27 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Benjamin Poirier @ 2016-02-18 0:20 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel, Eric Dumazet, Paul E. McKenney
follows up commit 45f6fad84cc3 ("ipv6: add complete rcu protection around
np->opt") which added mixed rcu/refcount protection to np->opt.
Given the current implementation of rcu_pointer_handoff(), this has no
effect at runtime.
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
---
include/net/ipv6.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 6570f37..f3c9857 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -259,8 +259,12 @@ static inline struct ipv6_txoptions *txopt_get(const struct ipv6_pinfo *np)
rcu_read_lock();
opt = rcu_dereference(np->opt);
- if (opt && !atomic_inc_not_zero(&opt->refcnt))
- opt = NULL;
+ if (opt) {
+ if (!atomic_inc_not_zero(&opt->refcnt))
+ opt = NULL;
+ else
+ opt = rcu_pointer_handoff(opt);
+ }
rcu_read_unlock();
return opt;
}
--
2.7.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] ipv6: Annotate change of locking mechanism for np->opt
2016-02-18 0:20 [PATCH] ipv6: Annotate change of locking mechanism for np->opt Benjamin Poirier
@ 2016-02-18 8:08 ` Eric Dumazet
2016-02-18 20:27 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2016-02-18 8:08 UTC (permalink / raw)
To: Benjamin Poirier; +Cc: netdev, linux-kernel, Paul E. McKenney
On mer., 2016-02-17 at 16:20 -0800, Benjamin Poirier wrote:
> follows up commit 45f6fad84cc3 ("ipv6: add complete rcu protection around
> np->opt") which added mixed rcu/refcount protection to np->opt.
>
> Given the current implementation of rcu_pointer_handoff(), this has no
> effect at runtime.
>
> Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
> ---
LGTM
Acked-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ipv6: Annotate change of locking mechanism for np->opt
2016-02-18 0:20 [PATCH] ipv6: Annotate change of locking mechanism for np->opt Benjamin Poirier
2016-02-18 8:08 ` Eric Dumazet
@ 2016-02-18 20:27 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-02-18 20:27 UTC (permalink / raw)
To: bpoirier; +Cc: netdev, linux-kernel, eric.dumazet, paulmck
From: Benjamin Poirier <bpoirier@suse.com>
Date: Wed, 17 Feb 2016 16:20:33 -0800
> follows up commit 45f6fad84cc3 ("ipv6: add complete rcu protection around
> np->opt") which added mixed rcu/refcount protection to np->opt.
>
> Given the current implementation of rcu_pointer_handoff(), this has no
> effect at runtime.
>
> Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Since it has no effect on run-time, applied to net-next, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-18 20:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-18 0:20 [PATCH] ipv6: Annotate change of locking mechanism for np->opt Benjamin Poirier
2016-02-18 8:08 ` Eric Dumazet
2016-02-18 20:27 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox