mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
sched_ext: Set errno on ENABLING -> ENABLED transition failure
If the SCX_ENABLING -> SCX_ENABLED cmpxchg at the tail of scx_root_enable_workfn() fails, the function jumps to err_disable without setting ret. At that point ret still holds the return value of the last successful __scx_init_task() call, which is 0, so the err_disable fallback reports the meaningless message: scx_root_enable() failed (0) Set ret = -EBUSY, consistent with the other enable-state guards at the top of the same function, so the fallback always reports a real errno. Signed-off-by: Liang Luo <luoliang@kylinos.cn> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
680e0718b9
commit
c5b9316cf3
|
|
@ -7520,6 +7520,7 @@ static void scx_root_enable_workfn(struct kthread_work *work)
|
|||
|
||||
if (!scx_tryset_enable_state(SCX_ENABLED, SCX_ENABLING)) {
|
||||
WARN_ON_ONCE(atomic_read(&sch->exit_kind) == SCX_EXIT_NONE);
|
||||
ret = -EBUSY;
|
||||
goto err_disable;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user