Commit 99e95627 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] cancel_delayed_work() fix

cancel_delayed_work() forgets to clear the workqueue's pending flag.  This
makes the workqueue appear to be permanently busy, so any subsequent attempts
to use it will fail.
parent db6b3bf0
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/bitops.h>
struct workqueue_struct; struct workqueue_struct;
...@@ -75,8 +76,12 @@ extern void init_workqueues(void); ...@@ -75,8 +76,12 @@ extern void init_workqueues(void);
*/ */
static inline int cancel_delayed_work(struct work_struct *work) static inline int cancel_delayed_work(struct work_struct *work)
{ {
return del_timer_sync(&work->timer); int ret;
ret = del_timer_sync(&work->timer);
if (ret)
clear_bit(0, &work->pending);
return ret;
} }
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment