提交 546c5fc5 编写于 作者: L Lu Jialin 提交者: Zheng Zengkai

cgroup: Return ERSCH when add Z process into task

hulk inclusion
category: bugfix
Bugzilla: 47951
CVE: NA

--------------------------

When echo a Z process into tasks, it should return -ERSCH instead of 0.
Signed-off-by: NLu Jialin <lujialin4@huawei.com>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 03c358a8
...@@ -2697,6 +2697,7 @@ int cgroup_migrate_prepare_dst(struct cgroup_mgctx *mgctx) ...@@ -2697,6 +2697,7 @@ int cgroup_migrate_prepare_dst(struct cgroup_mgctx *mgctx)
int cgroup_migrate(struct task_struct *leader, bool threadgroup, int cgroup_migrate(struct task_struct *leader, bool threadgroup,
struct cgroup_mgctx *mgctx) struct cgroup_mgctx *mgctx)
{ {
int err = 0;
struct task_struct *task; struct task_struct *task;
/* /*
...@@ -2709,13 +2710,16 @@ int cgroup_migrate(struct task_struct *leader, bool threadgroup, ...@@ -2709,13 +2710,16 @@ int cgroup_migrate(struct task_struct *leader, bool threadgroup,
task = leader; task = leader;
do { do {
cgroup_migrate_add_task(task, mgctx); cgroup_migrate_add_task(task, mgctx);
if (!threadgroup) if (!threadgroup) {
if (task->flags & PF_EXITING)
err = -ESRCH;
break; break;
}
} while_each_thread(leader, task); } while_each_thread(leader, task);
rcu_read_unlock(); rcu_read_unlock();
spin_unlock_irq(&css_set_lock); spin_unlock_irq(&css_set_lock);
return cgroup_migrate_execute(mgctx); return err ? err : cgroup_migrate_execute(mgctx);
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册