]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bpf: task_group_seq_get_next: fix the skip_if_dup_files check
authorOleg Nesterov <oleg@redhat.com>
Tue, 5 Sep 2023 15:46:51 +0000 (17:46 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 8 Sep 2023 15:42:19 +0000 (08:42 -0700)
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>
kernel/bpf/task_iter.c

index 1589ec3faded87642de0ec49822d889dafff0dad..2264870ae3fce27f7d1e2426e1f0b5b3c3bb38e2 100644 (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;
        }