PERFORCE change 150555 for review

Ed Schouten ed at FreeBSD.org
Sat Sep 27 10:23:30 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=150555

Change 150555 by ed at ed_dull on 2008/09/27 10:22:38

	Add a little more sanity checking to tty_(timed)wait().
	
	In our current TTY layer design it isn't possible to sleep on a
	TTY that has been abandoned by the driver. Add an assertion to
	tty_(timed)wait() to disallow sleeping when the TTY is gone.

Affected files ...

.. //depot/projects/mpsafetty/sys/kern/tty.c#51 edit

Differences ...

==== //depot/projects/mpsafetty/sys/kern/tty.c#51 (text+ko) ====

@@ -1189,6 +1189,7 @@
 	tty_lock_assert(tp, MA_OWNED|MA_NOTRECURSED);
 #endif
 	tty_lock_assert(tp, MA_OWNED);
+	MPASS(!tty_gone(tp));
 
 	error = cv_wait_sig(cv, tp->t_mtx);
 
@@ -1214,6 +1215,7 @@
 	tty_lock_assert(tp, MA_OWNED|MA_NOTRECURSED);
 #endif
 	tty_lock_assert(tp, MA_OWNED);
+	MPASS(!tty_gone(tp));
 
 	error = cv_timedwait_sig(cv, tp->t_mtx, hz);
 


More information about the p4-projects mailing list