Skip to contentSkip to conversation

ns: Fix time_for_children symlink

PATCH Applied Michael Kerrisk (man-pages) 5 participants 5 messages Apr 3, 2020 – Apr 7, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ns: Fix time_for_children symlink

Dmitry, Andrei,

Looking at the contents of the /proc/PID/ns/time_for_children symlink shows an anomaly:

$ ls -l /proc/self/ns/* |awk '{print $9, $10, $11}'
...
/proc/self/ns/pid -> pid:[4026531836]
/proc/self/ns/pid_for_children -> pid:[4026531836]
/proc/self/ns/time -> time:[4026531834]
/proc/self/ns/time_for_children -> time_for_children:[4026531834]
/proc/self/ns/user -> user:[4026531837]
...

The reference for 'time_for_children' should be a 'time' namespace, just as the reference for 'pid_for_children' is a 'pid' namespace. In other words, I think the above time_for_children link should read:

/proc/self/ns/time_for_children -> time:[4026531834]

If you agree with this patch, then it should be marked for [email protected].

---
 kernel/time/namespace.c | 1 +
 1 file changed, 1 insertion(+)
kernel/time/namespace.c +1 -0
index e6ba064ce773..3b30288793fe 100644
@@ -447,6 +447,7 @@ const struct proc_ns_operations timens_operations = {
 
 const struct proc_ns_operations timens_for_children_operations = {
 	.name		= "time_for_children",
+	.real_ns_name	= "time",
 	.type		= CLONE_NEWTIME,
 	.get		= timens_for_children_get,
 	.put		= timens_put,
Signature · 6 lines
2.25.1

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines · Michael Kerrisk (man-pages)

Dmitry, Andrei,

Looking at the contents of the /proc/PID/ns/time_for_children symlink shows an anomaly:

$ ls -l /proc/self/ns/* |awk '{print $9, $10, $11}'
...
/proc/self/ns/pid -> pid:[4026531836]
/proc/self/ns/pid_for_children -> pid:[4026531836]
/proc/self/ns/time -> time:[4026531834]
/proc/self/ns/time_for_children -> time_for_children:[4026531834]
/proc/self/ns/user -> user:[4026531837]
...

The reference for 'time_for_children' should be a 'time' namespace, just as the reference for 'pid_for_children' is a 'pid' namespace. In other words, I think the above time_for_children link should read:

Quoted 6 lines

/proc/self/ns/time_for_children -> time:[4026531834]

If you agree with this patch, then it should be marked for [email protected].

Yeah, that just seems like an oversight.

Reviewed-by
#2 lore raw
Quoted 21 lines · Christian Brauner
Quoted 20 lines · Michael Kerrisk (man-pages)

Dmitry, Andrei,

Looking at the contents of the /proc/PID/ns/time_for_children symlink shows an anomaly:

$ ls -l /proc/self/ns/* |awk '{print $9, $10, $11}'
...
/proc/self/ns/pid -> pid:[4026531836]
/proc/self/ns/pid_for_children -> pid:[4026531836]
/proc/self/ns/time -> time:[4026531834]
/proc/self/ns/time_for_children -> time_for_children:[4026531834]
/proc/self/ns/user -> user:[4026531837]
...

The reference for 'time_for_children' should be a 'time' namespace, just as the reference for 'pid_for_children' is a 'pid' namespace. In other words, I think the above time_for_children link should read:

/proc/self/ns/time_for_children -> time:[4026531834]

Quoted 8 lines
Quoted 4 lines

If you agree with this patch, then it should be marked for [email protected].

Yeah, that just seems like an oversight.

Thanks,

Fixes 769071ac9f20 ("ns: Introduce Time Namespace")

+Cc: stable # v5.6

Signature · 1 line
          Dmitry
Acked-by on v1 1/1
#3 lore raw
In reply to Michael Kerrisk (man-pages)
Quoted 14 lines · Michael Kerrisk (man-pages)

Dmitry, Andrei,

Looking at the contents of the /proc/PID/ns/time_for_children symlink shows an anomaly:

$ ls -l /proc/self/ns/* |awk '{print $9, $10, $11}'
...
/proc/self/ns/pid -> pid:[4026531836]
/proc/self/ns/pid_for_children -> pid:[4026531836]
/proc/self/ns/time -> time:[4026531834]
/proc/self/ns/time_for_children -> time_for_children:[4026531834]
/proc/self/ns/user -> user:[4026531837]
...
Quoted 9 lines

The reference for 'time_for_children' should be a 'time' namespace, just as the reference for 'pid_for_children' is a 'pid' namespace. In other words, I think the above time_for_children link should read:

/proc/self/ns/time_for_children -> time:[4026531834]

If you agree with this patch, then it should be marked for [email protected].

Quoted 1 line
#4 lore raw

[tip: timers/urgent] time/namespace: Fix time_for_children symlink

In reply to Michael Kerrisk (man-pages)
The following commit has been merged into the timers/urgent branch of tip:

The following commit has been merged into the timers/urgent branch of tip:

Commit-ID:     b801f1e22c23c259d6a2c955efddd20370de19a6
Gitweb:        https://git.kernel.org/tip/b801f1e22c23c259d6a2c955efddd20370de19a6
Author:        Michael Kerrisk (man-pages) <[email protected]>
AuthorDate:    Fri, 03 Apr 2020 14:11:39 +02:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Tue, 07 Apr 2020 12:37:21 +02:00

time/namespace: Fix time_for_children symlink

Looking at the contents of the /proc/PID/ns/time_for_children symlink shows an anomaly:

$ ls -l /proc/self/ns/* |awk '{print $9, $10, $11}'
...
/proc/self/ns/pid -> pid:[4026531836]
/proc/self/ns/pid_for_children -> pid:[4026531836]
/proc/self/ns/time -> time:[4026531834]
/proc/self/ns/time_for_children -> time_for_children:[4026531834]
/proc/self/ns/user -> user:[4026531837]
...

The reference for 'time_for_children' should be a 'time' namespace, just as the reference for 'pid_for_children' is a 'pid' namespace. In other words, the above time_for_children link should read:

/proc/self/ns/time_for_children -> time:[4026531834]

---
 kernel/time/namespace.c | 1 +
 1 file changed, 1 insertion(+)
kernel/time/namespace.c +1 -0
index e6ba064..3b30288 100644
@@ -447,6 +447,7 @@ const struct proc_ns_operations timens_operations = {
 
 const struct proc_ns_operations timens_for_children_operations = {
 	.name		= "time_for_children",
+	.real_ns_name	= "time",
 	.type		= CLONE_NEWTIME,
 	.get		= timens_for_children_get,
 	.put		= timens_put,