bpf: task_group_seq_get_next: fix the skip_if_dup_files check

Unless I am notally confused it is wrong. We are going to return or
skip next_task so we need to check next_task-files, not task->files.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20230905154651.GA24940@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
Oleg Nesterov 2023-09-05 17:46:51 +02:00 committed by Alexei Starovoitov
parent 4981921350
commit 87abbf7a54

View File

@ -82,7 +82,7 @@ retry:
common->pid_visiting = *tid;
if (skip_if_dup_files && task->files == task->group_leader->files) {
if (skip_if_dup_files && next_task->files == next_task->group_leader->files) {
task = next_task;
goto retry;
}