summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjch <jch@FreeBSD.org>2015-08-27 08:15:32 +0000
committerjch <jch@FreeBSD.org>2015-08-27 08:15:32 +0000
commit433b16759b09dba93b94a1ff1a85dd74e64c6de2 (patch)
tree83fb480b5386198ebb302b609bbf592b38ba4736
parent27508342ba7eaf88079d21b9309746d340c8f5e2 (diff)
downloadFreeBSD-src-433b16759b09dba93b94a1ff1a85dd74e64c6de2.zip
FreeBSD-src-433b16759b09dba93b94a1ff1a85dd74e64c6de2.tar.gz
In callout_stop(), if a callout is both pending and currently
being serviced return 0 (fail) but it is applicable only mpsafe callouts. Thanks to hselasky for finding this. Differential Revision: https://reviews.freebsd.org/D3078 (Updated) Submitted by: hselasky Reviewed by: jch
-rw-r--r--sys/kern/kern_timeout.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
index 21f4789..995954d 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -1379,11 +1379,13 @@ again:
}
callout_cc_del(c, cc);
- /*
- * If we are asked to stop a callout which is currently in progress
- * and indeed impossible to stop then return 0.
- */
- not_running = !(cc_exec_curr(cc, direct) == c);
+ if (!use_lock) {
+ /*
+ * If we are asked to stop a callout which is currently in progress
+ * and indeed impossible to stop then return 0.
+ */
+ not_running = !(cc_exec_curr(cc, direct) == c);
+ }
CC_UNLOCK(cc);
return (not_running);
OpenPOWER on IntegriCloud