]> git.karo-electronics.de Git - linux-beck.git/commit
list: Use WRITE_ONCE() when initializing list_head structures
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 12 Oct 2015 23:56:42 +0000 (16:56 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 4 Dec 2015 20:34:33 +0000 (12:34 -0800)
commit2f073848c3cc8aff2655ab7c46d8c0de90cf4e50
treea30a9e1b6f0edd5d1837c214cbf26c762fdb0a54
parent7d86dccf28a3ae2f790f399fc82d4c82521fd078
list: Use WRITE_ONCE() when initializing list_head structures

Code that does lockless emptiness testing of non-RCU lists is relying
on INIT_LIST_HEAD() to write the list head's ->next pointer atomically,
particularly when INIT_LIST_HEAD() is invoked from list_del_init().
This commit therefore adds WRITE_ONCE() to this function's pointer stores
that could affect the head's ->next pointer.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
include/linux/list.h