提交 9dffff20 编写于 作者: F Florian Westphal 提交者: Steffen Klassert

xfrm: policy: use hlist rcu variants on insert

bydst table/list lookups use rcu, so insertions must use rcu versions.

Fixes: a7c44247 ("xfrm: policy: make xfrm_policy_lookup_bytype lockless")
Signed-off-by: NFlorian Westphal <fw@strlen.de>
Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
上级 9f7e43da
...@@ -632,9 +632,9 @@ static void xfrm_hash_rebuild(struct work_struct *work) ...@@ -632,9 +632,9 @@ static void xfrm_hash_rebuild(struct work_struct *work)
break; break;
} }
if (newpos) if (newpos)
hlist_add_behind(&policy->bydst, newpos); hlist_add_behind_rcu(&policy->bydst, newpos);
else else
hlist_add_head(&policy->bydst, chain); hlist_add_head_rcu(&policy->bydst, chain);
} }
spin_unlock_bh(&net->xfrm.xfrm_policy_lock); spin_unlock_bh(&net->xfrm.xfrm_policy_lock);
...@@ -774,9 +774,9 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) ...@@ -774,9 +774,9 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
break; break;
} }
if (newpos) if (newpos)
hlist_add_behind(&policy->bydst, newpos); hlist_add_behind_rcu(&policy->bydst, newpos);
else else
hlist_add_head(&policy->bydst, chain); hlist_add_head_rcu(&policy->bydst, chain);
__xfrm_policy_link(policy, dir); __xfrm_policy_link(policy, dir);
/* After previous checking, family can either be AF_INET or AF_INET6 */ /* After previous checking, family can either be AF_INET or AF_INET6 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册