bugfix: share kernel thread group should not dup files from caller group
Docker-Linux / push (push) Has been cancelled
Build Documentation / build-html (push) Has been cancelled

after this commits
  commit e7fa4cae6cbf567266985c8072db1f51ad480943
  Author: Yanfeng Liu <yfliu2008@qq.com>
  Date: Fri May 17 06:11:52 2024 +0800

  sched/tcb: use shared group for kthreads

all kernel thread share group idle
and should not dup filelist to this group

Signed-off-by: guohao15 <guohao15@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
guohao15
2025-02-08 06:47:45 +00:00
committed by Xiang Xiao
parent 74d52767e9
commit 57d83907dd
+7 -3
View File
@@ -79,15 +79,19 @@ int group_setuptaskfiles(FAR struct task_tcb_s *tcb,
#ifndef CONFIG_FDCLONE_DISABLE
DEBUGASSERT(rtcb->group);
/* Duplicate the parent task's file descriptors */
/* With the exception of kernel threads, duplicate the parent task's
* file descriptors.
*/
if (group != rtcb->group)
if (group != rtcb->group &&
(tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) != TCB_FLAG_TTYPE_KERNEL)
{
ret = fdlist_copy(&rtcb->group->tg_fdlist,
&group->tg_fdlist, actions, cloexec);
}
if (ret >= 0 && actions != NULL)
if (ret >= 0 && actions != NULL &&
(tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) != TCB_FLAG_TTYPE_KERNEL)
{
ret = spawn_file_actions(&tcb->cmn, actions);
}