From: Cyril Hrubis Date: Tue, 3 Mar 2020 15:06:38 +0000 (+0100) Subject: sys/sysinfo: Respect boottime inside time namespace X-Git-Tag: v5.10.7~3063^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ecc421e05bab97cf3ff4fe456ade47ef84dba8c2;p=platform%2Fkernel%2Flinux-rpi.git sys/sysinfo: Respect boottime inside time namespace The sysinfo() syscall includes uptime in seconds but has no correction for time namespaces which makes it inconsistent with the /proc/uptime inside of a time namespace. Add the missing time namespace adjustment call. Signed-off-by: Cyril Hrubis Signed-off-by: Thomas Gleixner Reviewed-by: Dmitry Safonov Link: https://lkml.kernel.org/r/20200303150638.7329-1-chrubis@suse.cz --- diff --git a/kernel/sys.c b/kernel/sys.c index f9bc5c3..d325f3a 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -2546,6 +2547,7 @@ static int do_sysinfo(struct sysinfo *info) memset(info, 0, sizeof(struct sysinfo)); ktime_get_boottime_ts64(&tp); + timens_add_boottime(&tp); info->uptime = tp.tv_sec + (tp.tv_nsec ? 1 : 0); get_avenrun(info->loads, 0, SI_LOAD_SHIFT - FSHIFT);