svn commit: r303159 - stable/11/sys/kern

Gleb Smirnoff glebius at FreeBSD.org
Thu Jul 21 19:18:50 UTC 2016


Author: glebius
Date: Thu Jul 21 19:18:49 2016
New Revision: 303159
URL: https://svnweb.freebsd.org/changeset/base/303159

Log:
  Merge r302894, r303098: fix regression caused by r302350. Stopping a
  not scheduled not running callout should return (-1).
  
  PR:		210884
  Approved by:	re (gjb)

Modified:
  stable/11/sys/kern/kern_timeout.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_timeout.c
==============================================================================
--- stable/11/sys/kern/kern_timeout.c	Thu Jul 21 18:47:51 2016	(r303158)
+++ stable/11/sys/kern/kern_timeout.c	Thu Jul 21 19:18:49 2016	(r303159)
@@ -1380,6 +1380,12 @@ again:
 	if ((c->c_iflags & CALLOUT_PENDING) == 0) {
 		CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
 		    c, c->c_func, c->c_arg);
+		/*
+		 * For not scheduled and not executing callout return
+		 * negative value.
+		 */
+		if (cc_exec_curr(cc, direct) != c)
+			cancelled = -1;
 		CC_UNLOCK(cc);
 		return (cancelled);
 	}


More information about the svn-src-stable mailing list