[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4BzY8ePP7PoOpeU1uS1AFicGzY-w28KM2DMhjPqz4Tuh7bA@mail.gmail.com>
Date: Fri, 18 Dec 2020 13:02:09 -0800
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Jonathan Lemon <jonathan.lemon@...il.com>
Cc: Networking <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Yonghong Song <yhs@...com>, bpf <bpf@...r.kernel.org>,
Kernel Team <kernel-team@...com>
Subject: Re: [PATCH 2/3 v4 bpf-next] bpf: Use thread_group_leader()
On Fri, Dec 18, 2020 at 12:47 PM Jonathan Lemon
<jonathan.lemon@...il.com> wrote:
>
> From: Jonathan Lemon <bsd@...com>
>
> 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 <jonathan.lemon@...il.com>
> ---
Acked-by: Andrii Nakryiko <andrii@...nel.org>
> kernel/bpf/task_iter.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/bpf/task_iter.c b/kernel/bpf/task_iter.c
> index 8033ab19138a..dc4007f1843b 100644
> --- a/kernel/bpf/task_iter.c
> +++ b/kernel/bpf/task_iter.c
> @@ -37,7 +37,7 @@ static struct task_struct *task_seq_get_next(struct pid_namespace *ns,
> if (!task) {
> ++*tid;
> goto retry;
> - } else if (skip_if_dup_files && task->tgid != task->pid &&
> + } else if (skip_if_dup_files && !thread_group_leader(task) &&
> task->files == task->group_leader->files) {
> put_task_struct(task);
> task = NULL;
> --
> 2.24.1
>
Powered by blists - more mailing lists