@@ -392,8 +392,10 @@ unsigned long get_taint(void)
*/
void add_taint(unsigned flag, enum lockdep_ok lockdep_ok)
{
- if (lockdep_ok == LOCKDEP_NOW_UNRELIABLE && __debug_locks_off())
+ if (lockdep_ok == LOCKDEP_NOW_UNRELIABLE && __debug_locks_off()) {
pr_warn("Disabling lock debugging due to kernel taint\n");
+ set_bit(TAINT_CRAP, &tainted_mask);
+ }
set_bit(flag, &tainted_mask);
}
@@ -38,6 +38,7 @@ EXPORT_SYMBOL_GPL(debug_locks_silent);
int debug_locks_off(void)
{
if (__debug_locks_off()) {
+ add_taint(TAINT_CRAP, LOCKDEP_STILL_OK);
if (!debug_locks_silent) {
console_verbose();
return 1;
When testing with lockdep disabled, if it becomes disabled due to some error or other that makes subsequenting testing incomplete, it taints the test result. Make this obvious to the test infrastructure by adding TAINT_CRAP. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> --- Thoughts? Preferred over parsing lock_stats in addition to kernel/taint? Downside is that since locks are disabled before oops printing and the like, we will see TAINT_CRAP on first oops/panic (I think) rather than subsequent oopses. -Chris --- kernel/panic.c | 4 +++- lib/debug_locks.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-)