Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Sep 2020 18:24:28 +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-12@freebsd.org
Subject:   svn commit: r365963 - stable/12/sys/kern
Message-ID:  <202009211824.08LIOSfx005606@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Sep 21 18:24:28 2020
New Revision: 365963
URL: https://svnweb.freebsd.org/changeset/base/365963

Log:
  MFC r365238:
  Assert that cc_exec_drain(cc, direct) is NULL before assigning a new value.
  
  Suggested by:	markj@
  Tested by:	callout_test
  Sponsored by:	Mellanox Technologies // NVIDIA Networking

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

Modified: stable/12/sys/kern/kern_timeout.c
==============================================================================
--- stable/12/sys/kern/kern_timeout.c	Mon Sep 21 18:21:59 2020	(r365962)
+++ stable/12/sys/kern/kern_timeout.c	Mon Sep 21 18:24:28 2020	(r365963)
@@ -1382,6 +1382,9 @@ again:
 			CTR3(KTR_CALLOUT, "postponing stop %p func %p arg %p",
 			    c, c->c_func, c->c_arg);
  			if (drain) {
+				KASSERT(cc_exec_drain(cc, direct) == NULL,
+				    ("callout drain function already set to %p",
+				    cc_exec_drain(cc, direct)));
 				cc_exec_drain(cc, direct) = drain;
 			}
 			CC_UNLOCK(cc);
@@ -1390,6 +1393,9 @@ again:
 			CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
 			    c, c->c_func, c->c_arg);
 			if (drain) {
+				KASSERT(cc_exec_drain(cc, direct) == NULL,
+				    ("callout drain function already set to %p",
+				    cc_exec_drain(cc, direct)));
 				cc_exec_drain(cc, direct) = drain;
 			}
 		}



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