[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMw=ZnRp5N6tU=4T5VTbk-jx58fFUM=1YdkWc2MsmrDqkO2BZA@mail.gmail.com>
Date: Fri, 4 Oct 2024 20:40:37 +0100
From: Luca Boccassi <luca.boccassi@...il.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Christian Brauner <brauner@...nel.org>, Jeff Layton <jlayton@...nel.org>,
Josef Bacik <josef@...icpanda.com>, linux-kernel@...r.kernel.org, paul@...l-moore.com,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] pidfd: add ioctl to retrieve pid info
On Fri, 4 Oct 2024 at 20:30, Oleg Nesterov <oleg@...hat.com> wrote:
>
> I wasn't CC'ed, so I didn't see the patch, but looking at Christian's
> reply ...
>
> On 10/04, Luca Boccassi wrote:
> > On Fri, 4 Oct 2024 at 10:29, Christian Brauner <brauner@...nel.org> wrote:
> > >
> > > On Wed, Oct 02, 2024 at 03:24:33PM GMT, luca.boccassi@...il.com wrote:
> > > > + info.pid = pid_nr_ns(pid, task_active_pid_ns(task));
> > >
> > > I think this is wrong what this should return is the pid of the process
> > > as seen from the caller's pid namespace.
>
> Agreed,
>
> > Thanks for the review, I applied the rest of the comments in v2 (I
> > think at least), but for this one I can't tell, how should I do it?
>
> I guess Christian meant you should simply use
>
> info.pid = task_pid_vnr(task);
>
> task_pid_vnr(task) returns the task's pid in the caller's namespace.
Ah I see, I didn't realize there was a difference, sent v3 with the
suggested change just now, thanks.
Powered by blists - more mailing lists