From: Oleg Nesterov <oleg@redhat.com>
To: Christian Brauner <brauner@kernel.org>
Cc: linux-fsdevel@vger.kernel.org, Jeff Layton <jlayton@kernel.org>,
Lennart Poettering <lennart@poettering.net>,
Daan De Meyer <daan.j.demeyer@gmail.com>,
Mike Yuan <me@yhndnzj.com>
Subject: Re: [PATCH v2] pidfs: ensure that PIDFS_INFO_EXIT is available
Date: Wed, 19 Mar 2025 13:05:00 +0100 [thread overview]
Message-ID: <20250319120500.GB26879@redhat.com> (raw)
In-Reply-To: <20250319-behielt-zensieren-e63e234730d2@brauner>
On 03/19, Christian Brauner wrote:
>
> On Tue, Mar 18, 2025 at 03:46:54PM +0100, Oleg Nesterov wrote:
> >
> > Why pidfs_pid_valid() can't simply return false if !pid_has_task(pid,type) ?
> >
> > pidfd_open() paths check pid_has_task() too and fail if it returns NULL.
> > If this task is already reaped when pidfs_pid_valid() is called, we can
> > pretend it was reaped before sys_pidfd_open() was called?
>
> We could for sure but why would we. If we know that exit information is
> available then returning a pidfd can still be valuable for userspace as
> they can retrieve exit information via PIDFD_INFO_EXIT and it really
> doesn't hurt to do this.
OK, agreed. I thought I missed another subtle reason.
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
prev parent reply other threads:[~2025-03-19 12:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-18 8:34 [PATCH v2] pidfs: ensure that PIDFS_INFO_EXIT is available Christian Brauner
2025-03-18 14:46 ` Oleg Nesterov
2025-03-19 8:14 ` Christian Brauner
2025-03-19 12:05 ` Oleg Nesterov [this message]
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=20250319120500.GB26879@redhat.com \
--to=oleg@redhat.com \
--cc=brauner@kernel.org \
--cc=daan.j.demeyer@gmail.com \
--cc=jlayton@kernel.org \
--cc=lennart@poettering.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=me@yhndnzj.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox