Make witness_warn() always print to the console.

witness_warn() either breaks into the debugger or panics the system, so its
output should go to the console regardless of the witness(4) output channel
configuration.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Mark Johnston 2017-02-05 02:27:04 +00:00
parent 3a2f282532
commit 69d2418faa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=313261

View File

@ -1732,15 +1732,14 @@ witness_warn(int flags, struct lock_object *lock, const char *fmt, ...)
continue;
if (n == 0) {
va_start(ap, fmt);
witness_voutput(fmt, ap);
vprintf(fmt, ap);
va_end(ap);
witness_output(
" with the following %slocks held:\n",
printf(" with the following %slocks held:\n",
(flags & WARN_SLEEPOK) != 0 ?
"non-sleepable " : "");
}
n++;
witness_list_lock(lock1, witness_output);
witness_list_lock(lock1, printf);
}
/*
@ -1765,11 +1764,11 @@ witness_warn(int flags, struct lock_object *lock, const char *fmt, ...)
return (0);
va_start(ap, fmt);
witness_voutput(fmt, ap);
vprintf(fmt, ap);
va_end(ap);
witness_output(" with the following %slocks held:\n",
printf(" with the following %slocks held:\n",
(flags & WARN_SLEEPOK) != 0 ? "non-sleepable " : "");
n += witness_list_locks(&lock_list, witness_output);
n += witness_list_locks(&lock_list, printf);
} else
sched_unpin();
if (flags & WARN_PANIC && n)