Commit c3138f38 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Tejun Heo

workqueue: Register sysfs after the whole creation of the new wq

workqueue creation includes adding it to the workqueue list.

Prepare for moving the whole workqueue initializing procedure into
wq_pool_mutex and cpu hotplug locks.
Signed-off-by: default avatarLai Jiangshan <jiangshan.ljs@antgroup.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent b3d20916
......@@ -5684,9 +5684,6 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
if (wq_online && init_rescuer(wq) < 0)
goto err_destroy;
if ((wq->flags & WQ_SYSFS) && workqueue_sysfs_register(wq))
goto err_destroy;
/*
* wq_pool_mutex protects global freeze state and workqueues list.
* Grab it, adjust max_active and add the new @wq to workqueues
......@@ -5702,6 +5699,9 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
mutex_unlock(&wq_pool_mutex);
if ((wq->flags & WQ_SYSFS) && workqueue_sysfs_register(wq))
goto err_destroy;
return wq;
err_free_node_nr_active:
......
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