aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2017-10-04 04:50:25 -0400
committerIngo Molnar <mingo@kernel.org>2017-10-10 04:04:29 -0400
commitc7e2f69d3ed2e56de1f5eaaf37c0f5f91d7adb0a (patch)
tree4c03ba202875cdcbe6c72fbc7a1f483af46f9c5c /lib
parent8b405d5c5d0996d3d16f70c42744a0500f5b6ec3 (diff)
locking/selftest: Avoid false BUG report
The work-around for the expected failure is providing another failure :/ Only when CONFIG_PROVE_LOCKING=y do we increment unexpected_testcase_failures, so only then do we need to decrement, otherwise we'll end up with a negative number and that will again trigger a BUG (printout, not crash). Reported-by: Fengguang Wu <fengguang.wu@intel.com> Tested-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes: d82fed752942 ("locking/lockdep/selftests: Fix mixed read-write ABBA tests") Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/locking-selftest.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c
index cd0b5c964bd0..2b827b8a1d8c 100644
--- a/lib/locking-selftest.c
+++ b/lib/locking-selftest.c
@@ -2031,11 +2031,13 @@ void locking_selftest(void)
2031 print_testname("mixed read-lock/lock-write ABBA"); 2031 print_testname("mixed read-lock/lock-write ABBA");
2032 pr_cont(" |"); 2032 pr_cont(" |");
2033 dotest(rlock_ABBA1, FAILURE, LOCKTYPE_RWLOCK); 2033 dotest(rlock_ABBA1, FAILURE, LOCKTYPE_RWLOCK);
2034#ifdef CONFIG_PROVE_LOCKING
2034 /* 2035 /*
2035 * Lockdep does indeed fail here, but there's nothing we can do about 2036 * Lockdep does indeed fail here, but there's nothing we can do about
2036 * that now. Don't kill lockdep for it. 2037 * that now. Don't kill lockdep for it.
2037 */ 2038 */
2038 unexpected_testcase_failures--; 2039 unexpected_testcase_failures--;
2040#endif
2039 2041
2040 pr_cont(" |"); 2042 pr_cont(" |");
2041 dotest(rwsem_ABBA1, FAILURE, LOCKTYPE_RWSEM); 2043 dotest(rwsem_ABBA1, FAILURE, LOCKTYPE_RWSEM);