rculist: Add ASSERT_EXCLUSIVE_ACCESS() to __list_splice_init_rcu()
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 12 Feb 2020 21:29:15 +0000 (13:29 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 29 Jun 2020 19:04:48 +0000 (12:04 -0700)
After the sync() in __list_splice_init_rcu(), there should be no
readers traversing the old list.  This commit therefore enlists the
help of KCSAN to verify this condition via a pair of calls to
ASSERT_EXCLUSIVE_ACCESS().

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Marco Elver <elver@google.com>
include/linux/rculist.h

index df587d181844b28d80732a0116b5ccd25c185636..2ebd112f86f72b6cabb3c6c96ed1e3353cf0d0ad 100644 (file)
@@ -248,6 +248,8 @@ static inline void __list_splice_init_rcu(struct list_head *list,
         */
 
        sync();
+       ASSERT_EXCLUSIVE_ACCESS(*first);
+       ASSERT_EXCLUSIVE_ACCESS(*last);
 
        /*
         * Readers are finished with the source list, so perform splice.