All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Luca Boccassi <luca.boccassi@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>,
	Jeff Layton <jlayton@kernel.org>,
	Josef Bacik <josef@toxicpanda.com>,
	linux-kernel@vger.kernel.org, paul@paul-moore.com,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] pidfd: add ioctl to retrieve pid info
Date: Sat, 5 Oct 2024 13:29:29 +0200	[thread overview]
Message-ID: <20241005112929.GA24386@redhat.com> (raw)
In-Reply-To: <CAMw=ZnRp5N6tU=4T5VTbk-jx58fFUM=1YdkWc2MsmrDqkO2BZA@mail.gmail.com>

On 10/04, Luca Boccassi wrote:
>
> On Fri, 4 Oct 2024 at 20:30, Oleg Nesterov <oleg@redhat.com> wrote:
> >
> > 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.

I didn't get v3, I guess I wasn't cc'ed again.

So, just in case, let me add that task_pid_vnr(task) can return 0 if
this task exits after get_pid_task().

Perhaps this is fine, I do not know. But perhaps you should actually
use pid_vnr(pid).

Oleg.


  reply	other threads:[~2024-10-05 11:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-02 14:24 [PATCH] pidfd: add ioctl to retrieve pid info luca.boccassi
2024-10-02 14:48 ` Paul Moore
2024-10-04 18:48   ` Luca Boccassi
2024-10-05 16:05     ` Paul Moore
2024-10-22 23:45       ` luca.boccassi
2024-10-22 23:56         ` Luca Boccassi
2024-10-24 23:14           ` Paul Moore
2024-10-24 23:31             ` Luca Boccassi
2024-10-03 21:54 ` kernel test robot
2024-10-03 21:54 ` kernel test robot
2024-10-04  3:55 ` kernel test robot
2024-10-04  9:29 ` Christian Brauner
2024-10-04 14:05   ` Paul Moore
2024-10-04 18:50   ` Luca Boccassi
2024-10-04 19:29     ` Oleg Nesterov
2024-10-04 19:40       ` Luca Boccassi
2024-10-05 11:29         ` Oleg Nesterov [this message]
2024-10-06 14:59           ` Luca Boccassi
2024-10-06 19:18   ` David Laight
2024-10-07 14:54   ` Josh Triplett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241005112929.GA24386@redhat.com \
    --to=oleg@redhat.com \
    --cc=brauner@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.boccassi@gmail.com \
    --cc=paul@paul-moore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.