]> git.baikalelectronics.ru Git - kernel.git/commit
workqueue: convert BUG_ON()s in __queue_delayed_work() to WARN_ON_ONCE()s
authorTejun Heo <tj@kernel.org>
Tue, 4 Dec 2012 15:40:39 +0000 (07:40 -0800)
committerTejun Heo <tj@kernel.org>
Tue, 4 Dec 2012 15:58:47 +0000 (07:58 -0800)
commit04b136b02e41486522108de947f575fefae9c1a6
tree83c8758213d3492b4c48541c8a3782bdd47adf99
parent719470675634fc902af50c53a2e9ae6949c018f2
workqueue: convert BUG_ON()s in __queue_delayed_work() to WARN_ON_ONCE()s

8d0685845c ("workqueue: mod_delayed_work_on() shouldn't queue timer on
0 delay") unexpectedly uncovered a very nasty abuse of delayed_work in
megaraid - it allocated work_struct, casted it to delayed_work and
then pass that into queue_delayed_work().

Previously, this was okay because 0 @delay short-circuited to
queue_work() before doing anything with delayed_work.  8d0685845c
moved 0 @delay test into __queue_delayed_work() after sanity check on
delayed_work making megaraid trigger BUG_ON().

Although megaraid is already fixed by 7194706756 ("megaraid: fix
BUG_ON() from incorrect use of delayed work"), this patch converts
BUG_ON()s in __queue_delayed_work() to WARN_ON_ONCE()s so that such
abusers, if there are more, trigger warning but don't crash the
machine.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Xiaotian Feng <xtfeng@gmail.com>
kernel/workqueue.c