Skip to content

Commit

Permalink
list: Don't use WRITE_ONCE() in hlist_add_behind()
Browse files Browse the repository at this point in the history
Commit 1c97be6 ("list: Use WRITE_ONCE() when adding to lists and
hlists") introduced the use of WRITE_ONCE() to atomically write the list
head's ->next pointer.

hlist_add_behind() doesn't touch the hlist head's ->first pointer so
there is no reason to use WRITE_ONCE() in this case.

Co-developed-by: Ilias Tsitsimpis <[email protected]>
Signed-off-by: Nikos Tsironis <[email protected]>
Reviewed-by: Paul E. McKenney <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
  • Loading branch information
ntsiron authored and snitm committed Apr 18, 2019
1 parent e28adc3 commit ae325dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ static inline void hlist_add_behind(struct hlist_node *n,
struct hlist_node *prev)
{
n->next = prev->next;
WRITE_ONCE(prev->next, n);
prev->next = n;
n->pprev = &prev->next;

if (n->next)
Expand Down

0 comments on commit ae325dc

Please sign in to comment.