svn commit: r248584 - head/sys/kern
John Baldwin
jhb at FreeBSD.org
Thu Mar 21 14:06:28 UTC 2013
Author: jhb
Date: Thu Mar 21 14:06:27 2013
New Revision: 248584
URL: http://svnweb.freebsd.org/changeset/base/248584
Log:
Another NFS SIGSTOP related fix: Ignore thread suspend requests due to
SIGSTOP if stop signals are currently deferred. This can occur if a
process is stopped via SIGSTOP while a thread is running or runnable
but before it has set TDF_SBDRY.
Tested by: pho
Reviewed by: kib
MFC after: 1 week
Modified:
head/sys/kern/kern_thread.c
Modified: head/sys/kern/kern_thread.c
==============================================================================
--- head/sys/kern/kern_thread.c Thu Mar 21 13:06:28 2013 (r248583)
+++ head/sys/kern/kern_thread.c Thu Mar 21 14:06:27 2013 (r248584)
@@ -795,6 +795,17 @@ thread_suspend_check(int return_instead)
return (ERESTART);
/*
+ * Ignore suspend requests for stop signals if they
+ * are deferred.
+ */
+ if (P_SHOULDSTOP(p) == P_STOPPED_SIG &&
+ td->td_flags & TDF_SBDRY) {
+ KASSERT(return_instead,
+ ("TDF_SBDRY set for unsafe thread_suspend_check"));
+ return (0);
+ }
+
+ /*
* If the process is waiting for us to exit,
* this thread should just suicide.
* Assumes that P_SINGLE_EXIT implies P_STOPPED_SINGLE.
More information about the svn-src-head
mailing list