Page MenuHomeFreeBSD

D26285.id76533.diff
No OneTemporary

D26285.id76533.diff

Index: head/sys/kern/kern_timeout.c
===================================================================
--- head/sys/kern/kern_timeout.c
+++ head/sys/kern/kern_timeout.c
@@ -1075,6 +1075,9 @@
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock,
"calling %s", __func__);
+ KASSERT((flags & CS_DRAIN) == 0 || drain == NULL,
+ ("Cannot set drain callback and CS_DRAIN flag at the same time"));
+
/*
* Some old subsystems don't hold Giant while running a callout_stop(),
* so just discard this check for the moment.
@@ -1270,11 +1273,12 @@
}
CC_UNLOCK(cc);
return ((flags & CS_EXECUTING) != 0);
- }
- CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
- c, c->c_func, c->c_arg);
- if (drain) {
- cc_exec_drain(cc, direct) = drain;
+ } else {
+ CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
+ c, c->c_func, c->c_arg);
+ if (drain) {
+ cc_exec_drain(cc, direct) = drain;
+ }
}
KASSERT(!sq_locked, ("sleepqueue chain still locked"));
cancelled = ((flags & CS_EXECUTING) != 0);

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 21, 8:15 PM (16 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25795704
Default Alt Text
D26285.id76533.diff (1 KB)

Event Timeline