diff options
author | Tejun Heo <tj@kernel.org> | 2012-08-21 13:18:24 -0700 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-08-21 13:18:24 -0700 |
commit | 57b30ae77bf00d2318df711ef9a4d2a9be0a3a2a (patch) | |
tree | d6e084bf0e2b82bb39302ee0e94e6f3f04762dbc /block | |
parent | e7c2f967445dd2041f0f8e3179cca22bb8bb7f79 (diff) | |
download | op-kernel-dev-57b30ae77bf00d2318df711ef9a4d2a9be0a3a2a.zip op-kernel-dev-57b30ae77bf00d2318df711ef9a4d2a9be0a3a2a.tar.gz |
workqueue: reimplement cancel_delayed_work() using try_to_grab_pending()
cancel_delayed_work() can't be called from IRQ handlers due to its use
of del_timer_sync() and can't cancel work items which are already
transferred from timer to worklist.
Also, unlike other flush and cancel functions, a canceled delayed_work
would still point to the last associated cpu_workqueue. If the
workqueue is destroyed afterwards and the work item is re-used on a
different workqueue, the queueing code can oops trying to dereference
already freed cpu_workqueue.
This patch reimplements cancel_delayed_work() using
try_to_grab_pending() and set_work_cpu_and_clear_pending(). This
allows the function to be called from IRQ handlers and makes its
behavior consistent with other flush / cancel functions.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'block')
0 files changed, 0 insertions, 0 deletions