Skip to content

Commit 34e8256

Browse files
Xuanqiang LuoFrederic Weisbecker
authored andcommitted
rcu: use WRITE_ONCE() for ->next and ->pprev of hlist_nulls
In rculist_nulls.h we can still see ordinary assignments to ->pprev and ->next of hlist_nulls. As noted in the two patches below: commit efd04f8 ("rcu: Use WRITE_ONCE() for assignments to ->next for rculist_nulls") commit 860c880 ("rcu: Use WRITE_ONCE() for assignments to ->pprev for hlist_nulls") We should use WRITE_ONCE(). Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
1 parent e52b438 commit 34e8256

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

include/linux/rculist_nulls.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static inline void hlist_nulls_add_tail_rcu(struct hlist_nulls_node *n,
138138

139139
if (last) {
140140
WRITE_ONCE(n->next, last->next);
141-
n->pprev = &last->next;
141+
WRITE_ONCE(n->pprev, &last->next);
142142
rcu_assign_pointer(hlist_nulls_next_rcu(last), n);
143143
} else {
144144
hlist_nulls_add_head_rcu(n, h);
@@ -148,8 +148,8 @@ static inline void hlist_nulls_add_tail_rcu(struct hlist_nulls_node *n,
148148
/* after that hlist_nulls_del will work */
149149
static inline void hlist_nulls_add_fake(struct hlist_nulls_node *n)
150150
{
151-
n->pprev = &n->next;
152-
n->next = (struct hlist_nulls_node *)NULLS_MARKER(NULL);
151+
WRITE_ONCE(n->pprev, &n->next);
152+
WRITE_ONCE(n->next, (struct hlist_nulls_node *)NULLS_MARKER(NULL));
153153
}
154154

155155
/**

0 commit comments

Comments
 (0)