提交 e550785c 编写于 作者: B Benjamin Poirier 提交者: David S. Miller

ipv6: Annotate change of locking mechanism for np->opt

follows up commit 45f6fad8 ("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: NBenjamin Poirier <bpoirier@suse.com>
Acked-by: NEric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f0a40450
...@@ -259,8 +259,12 @@ static inline struct ipv6_txoptions *txopt_get(const struct ipv6_pinfo *np) ...@@ -259,8 +259,12 @@ static inline struct ipv6_txoptions *txopt_get(const struct ipv6_pinfo *np)
rcu_read_lock(); rcu_read_lock();
opt = rcu_dereference(np->opt); opt = rcu_dereference(np->opt);
if (opt && !atomic_inc_not_zero(&opt->refcnt)) if (opt) {
opt = NULL; if (!atomic_inc_not_zero(&opt->refcnt))
opt = NULL;
else
opt = rcu_pointer_handoff(opt);
}
rcu_read_unlock(); rcu_read_unlock();
return opt; return opt;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册