]> git.baikalelectronics.ru Git - kernel.git/commit
proc, time/namespace: Show clock symbolic names in /proc/pid/timens_offsets
authorAndrei Vagin <avagin@gmail.com>
Sat, 11 Apr 2020 15:40:31 +0000 (08:40 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 16 Apr 2020 10:10:54 +0000 (12:10 +0200)
commitc5de7fdc99ba92802efc4f70cc3ad72e89e72371
tree400e92a597865e29a0875cc2015c7d3c94fd10d0
parent0e6c92ce1d170795a396f8108369eb2c8412797f
proc, time/namespace: Show clock symbolic names in /proc/pid/timens_offsets

Michael Kerrisk suggested to replace numeric clock IDs with symbolic names.

Now the content of these files looks like this:
$ cat /proc/774/timens_offsets
monotonic      864000         0
boottime      1728000         0

For setting offsets, both representations of clocks (numeric and symbolic)
can be used.

As for compatibility, it is acceptable to change things as long as
userspace doesn't care. The format of timens_offsets files is very new and
there are no userspace tools yet which rely on this format.

But three projects crun, util-linux and criu rely on the interface of
setting time offsets and this is why it's required to continue supporting
the numeric clock IDs on write.

Fixes: ba8a20ebfae4 ("fs/proc: Introduce /proc/pid/timens_offsets")
Suggested-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michael Kerrisk <mtk.manpages@gmail.com>
Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20200411154031.642557-1-avagin@gmail.com
fs/proc/base.c
kernel/time/namespace.c