Page MenuHomeFreeBSD

D26285.id76507.diff
No OneTemporary

D26285.id76507.diff

Index: sys/kern/kern_timeout.c
===================================================================
--- sys/kern/kern_timeout.c
+++ 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 when CS_DRAIN flag is set"));
+
/*
* 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 (11 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25767669
Default Alt Text
D26285.id76507.diff (1 KB)

Event Timeline