[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <492ad793692d03105f3ac2a2e1a3196dc01e5cef.camel@chromium.org>
Date: Fri, 27 Nov 2020 10:21:44 +0100
From: Florent Revest <revest@...omium.org>
To: Yonghong Song <yhs@...com>, bpf@...r.kernel.org
Cc: viro@...iv.linux.org.uk, davem@...emloft.net, kuba@...nel.org,
ast@...nel.org, daniel@...earbox.net, kafai@...com,
andrii@...nel.org, kpsingh@...omium.org, revest@...gle.com,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH bpf-next v3 5/6] bpf: Add an iterator selftest for
bpf_sk_storage_get
On Thu, 2020-11-26 at 23:00 -0800, Yonghong Song wrote:
> On 11/26/20 8:44 AM, Florent Revest wrote:
> > +SEC("iter/task_file")
> > +int fill_socket_owner(struct bpf_iter__task_file *ctx)
> > +{
> > + struct task_struct *task = ctx->task;
> > + struct file *file = ctx->file;
> > + struct socket *sock;
> > + int *sock_tgid;
> > +
> > + if (!task || !file || task->tgid != task->pid)
>
> task->tgid != task->pid is not needed here.
> The task_file iterator already tries to skip task with task->pid
> if its file table is the same as task->tgid.
Good to know!
Powered by blists - more mailing lists