|
@@ -325,8 +325,14 @@ struct task_struct *__kthread_create_on_node(int (*threadfn)(void *data),
|
|
task = create->result;
|
|
task = create->result;
|
|
if (!IS_ERR(task)) {
|
|
if (!IS_ERR(task)) {
|
|
static const struct sched_param param = { .sched_priority = 0 };
|
|
static const struct sched_param param = { .sched_priority = 0 };
|
|
|
|
+ char name[TASK_COMM_LEN];
|
|
|
|
|
|
- vsnprintf(task->comm, sizeof(task->comm), namefmt, args);
|
|
|
|
|
|
+ /*
|
|
|
|
+ * task is already visible to other tasks, so updating
|
|
|
|
+ * COMM must be protected.
|
|
|
|
+ */
|
|
|
|
+ vsnprintf(name, sizeof(name), namefmt, args);
|
|
|
|
+ set_task_comm(task, name);
|
|
/*
|
|
/*
|
|
* root may have changed our (kthreadd's) priority or CPU mask.
|
|
* root may have changed our (kthreadd's) priority or CPU mask.
|
|
* The kernel thread should not inherit these properties.
|
|
* The kernel thread should not inherit these properties.
|