Skip to content

Commit a61daaf

Browse files
jlemonborkmann
authored andcommitted
bpf: Use thread_group_leader()
Instead of directly comparing task->tgid and task->pid, use the thread_group_leader() helper. This helps with readability, and there should be no functional change. Signed-off-by: Jonathan Lemon <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 69ca310 commit a61daaf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/task_iter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static struct task_struct *task_seq_get_next(struct pid_namespace *ns,
3737
if (!task) {
3838
++*tid;
3939
goto retry;
40-
} else if (skip_if_dup_files && task->tgid != task->pid &&
40+
} else if (skip_if_dup_files && !thread_group_leader(task) &&
4141
task->files == task->group_leader->files) {
4242
put_task_struct(task);
4343
task = NULL;

0 commit comments

Comments
 (0)