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
This commit is contained in:
Julien Charbon 2015-08-27 08:15:32 +00:00
parent 3535eac433
commit 0cfae4b4bc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=287196

View File

@ -1379,11 +1379,13 @@ _callout_stop_safe(struct callout *c, int safe)
}
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);