workqueue: fix max_active handling in init_and_link_pwq()
authorTejun Heo <tj@kernel.org>
Wed, 13 Mar 2013 23:51:35 +0000 (16:51 -0700)
committerTejun Heo <tj@kernel.org>
Wed, 13 Mar 2013 23:51:35 +0000 (16:51 -0700)
commit983ca25e738ee0c9c5435a503a6bb0034d4552b0
tree24d945cc7c5476220f5d7c3a1fefddbc2f056373
parent699ce097efe8f45bc5c055e4f12cb1e271c270d9
workqueue: fix max_active handling in init_and_link_pwq()

Since 9e8cd2f589 ("workqueue: implement apply_workqueue_attrs()"),
init_and_link_pwq() may be called to initialize a new pool_workqueue
for a workqueue which is already online, but the function was setting
pwq->max_active to wq->saved_max_active without proper
synchronization.

Fix it by calling pwq_adjust_max_active() under proper locking instead
of manually setting max_active.

Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c