Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Mar 2013 14:06:27 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r248584 - head/sys/kern
Message-ID:  <201303211406.r2LE6RX8097668@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.



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