Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jan 2015 12:17:27 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r276969 - stable/10/sys/kern
Message-ID:  <201501111217.t0BCHRqn086751@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Sun Jan 11 12:17:27 2015
New Revision: 276969
URL: https://svnweb.freebsd.org/changeset/base/276969

Log:
  MFC r276532 and r276626:
  The "cnputs_mtx" mutex must be allowed to recurse. Debug prints and/or
  witness printouts in the console driver clients can cause this mutex
  to recurse by calls to "printf()" from witness for example. In
  particular this can happen if "debug.witness.skipspin=0" is set in the
  boot environment.

Modified:
  stable/10/sys/kern/kern_cons.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_cons.c
==============================================================================
--- stable/10/sys/kern/kern_cons.c	Sun Jan 11 12:08:17 2015	(r276968)
+++ stable/10/sys/kern/kern_cons.c	Sun Jan 11 12:17:27 2015	(r276969)
@@ -505,6 +505,13 @@ cnputs(char *p)
 	int unlock_reqd = 0;
 
 	if (use_cnputs_mtx) {
+	  	/*
+		 * NOTE: Debug prints and/or witness printouts in
+		 * console driver clients can cause the "cnputs_mtx"
+		 * mutex to recurse. Simply return if that happens.
+		 */
+		if (mtx_owned(&cnputs_mtx))
+			return;
 		mtx_lock_spin(&cnputs_mtx);
 		unlock_reqd = 1;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501111217.t0BCHRqn086751>