diff options
author | Dan Magenheimer <dan.magenheimer@oracle.com> | 2012-10-18 19:31:37 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-10-24 15:38:16 -0400 |
commit | c0158ca64da5732dfb86a3f28944e9626776692f (patch) | |
tree | 2ce9ff8057b9273905424b2932b35a080cfdbf38 /kernel | |
parent | ddffeb8c4d0331609ef2581d84de4d763607bd37 (diff) |
workqueue: cancel_delayed_work() should return %false if work item is idle
57b30ae77b ("workqueue: reimplement cancel_delayed_work() using
try_to_grab_pending()") made cancel_delayed_work() always return %true
unless someone else is also trying to cancel the work item, which is
broken - if the target work item is idle, the return value should be
%false.
try_to_grab_pending() indicates that the target work item was idle by
zero return value. Use it for return. Note that this brings
cancel_delayed_work() in line with __cancel_work_timer() in return
value handling.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
LKML-Reference: <444a6439-b1a4-4740-9e7e-bc37267cfe73@default>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/workqueue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index d951daa0ca9a..042d221d33cc 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -2982,7 +2982,7 @@ bool cancel_delayed_work(struct delayed_work *dwork) | |||
2982 | 2982 | ||
2983 | set_work_cpu_and_clear_pending(&dwork->work, work_cpu(&dwork->work)); | 2983 | set_work_cpu_and_clear_pending(&dwork->work, work_cpu(&dwork->work)); |
2984 | local_irq_restore(flags); | 2984 | local_irq_restore(flags); |
2985 | return true; | 2985 | return ret; |
2986 | } | 2986 | } |
2987 | EXPORT_SYMBOL(cancel_delayed_work); | 2987 | EXPORT_SYMBOL(cancel_delayed_work); |
2988 | 2988 | ||