Skip to content

Commit 38b43ec

Browse files
paulmckrcufbq
authored andcommitted
rcutorture: Complain when invalid SRCU reader_flavor is specified
Currently, rcutorture ignores reader_flavor bits that are not in the SRCU_READ_FLAVOR_ALL bitmask, which could confuse rcutorture users into believing buggy patches had been fully tested. This commit therefore produces a splat in this case. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
1 parent 5d45bdf commit 38b43ec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/rcu/rcutorture.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,8 @@ static int srcu_torture_read_lock(void)
689689
int idx;
690690
int ret = 0;
691691

692+
WARN_ON_ONCE(reader_flavor & ~SRCU_READ_FLAVOR_ALL);
693+
692694
if ((reader_flavor & SRCU_READ_FLAVOR_NORMAL) || !(reader_flavor & SRCU_READ_FLAVOR_ALL)) {
693695
idx = srcu_read_lock(srcu_ctlp);
694696
WARN_ON_ONCE(idx & ~0x1);

0 commit comments

Comments
 (0)