From: Oleg Nesterov <oleg@redhat.com>
To: Christian Brauner <brauner@kernel.org>
Cc: gaoxiang17 <gaoxiang17@xiaomi.com>,
Mateusz Guzik <mjguzik@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] pid: introduce task_ppid_vnr() helper
Date: Wed, 15 Oct 2025 14:36:33 +0200 [thread overview]
Message-ID: <20251015123633.GB9456@redhat.com> (raw)
In-Reply-To: <20251015123550.GA9447@redhat.com>
Cosmetic change. Unlike all other similar helpers task_ppid_nr_ns() doesn't
have a _vnr() version; add one for consistency.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
fs/pidfs.c | 2 +-
include/linux/pid.h | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/fs/pidfs.c b/fs/pidfs.c
index 0ef5b47d796a..43bc0113ba71 100644
--- a/fs/pidfs.c
+++ b/fs/pidfs.c
@@ -400,7 +400,7 @@ static long pidfd_info(struct file *file, unsigned int cmd, unsigned long arg)
* the fields are set correctly, or return ESRCH to avoid providing
* incomplete information. */
- kinfo.ppid = task_ppid_nr_ns(task, NULL);
+ kinfo.ppid = task_ppid_vnr(task);
kinfo.tgid = task_tgid_vnr(task);
kinfo.pid = task_pid_vnr(task);
kinfo.mask |= PIDFD_INFO_PID;
diff --git a/include/linux/pid.h b/include/linux/pid.h
index 003a1027d219..dd51bb08354c 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -310,6 +310,11 @@ static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_na
return pid;
}
+static inline pid_t task_ppid_vnr(const struct task_struct *tsk)
+{
+ return task_ppid_nr_ns(tsk, NULL);
+}
+
static inline pid_t task_ppid_nr(const struct task_struct *tsk)
{
return task_ppid_nr_ns(tsk, &init_pid_ns);
--
2.25.1.362.g51ebf55
next prev parent reply other threads:[~2025-10-15 12:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 12:35 [PATCH 0/2] Revert "pid: make __task_pid_nr_ns(ns => NULL) safe for zombie callers" Oleg Nesterov
2025-10-15 12:36 ` [PATCH 1/2] " Oleg Nesterov
2025-10-15 12:36 ` Oleg Nesterov [this message]
2026-01-29 14:59 ` [PATCH 0/2] " Christian Brauner
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=20251015123633.GB9456@redhat.com \
--to=oleg@redhat.com \
--cc=brauner@kernel.org \
--cc=gaoxiang17@xiaomi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjguzik@gmail.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.