Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3827438ybf; Tue, 3 Mar 2020 13:39:36 -0800 (PST) X-Google-Smtp-Source: ADFU+vt7VHeKCbhMvdhQPa8PHbfdJ1jVg2w+vpBmrV2+95YuK3blCAa447QDvgGS1xgxENs8/sih X-Received: by 2002:aca:75d7:: with SMTP id q206mr434306oic.27.1583271576731; Tue, 03 Mar 2020 13:39:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583271576; cv=none; d=google.com; s=arc-20160816; b=WwfeVsovSyjmgHC6lChh4R+sMcaKBkz9gjyQ9A7kMg3xgYaBRoQ8UvxGv2rHdh6Doj 0v5Lp97EBL3pMyiHwM3T56jCPwOJSOuIVSgQDOy3QgFxtDNmhV5K06ml+hdgv1XGgOtU nZqdX15GHrdVUJRV8m+W/P2iQSPQx0sfA/Qsp4/HqbTG6b/sP2G9RPYtUOZG8KZ5tzYY HI6x1S30O1D9FbWG56d3OSA8r/BUdNoKXAi5BJlreCHdly2BZ5zwHV72gsE/fTDS+WMV D2JxR+faY+kFzeOR07DnKWLoNJ7EW4z9k+SaS8oAijQzTrp+GhxiBFbXHsBz6Ry5P0e4 xImw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=LidmbmrYa1hJmyX4SZurMOBEr21CQAS1vDGw4yVjFK0=; b=Jn+m1noRdfSzOk9/abH2qMKhukqMH1q7afury7gNM9jZaTfbcPmBUVk1E7sTMIrIX6 iQHB9MHZf5XkkyFtIkmNPjaF0NkIm4KzvREa9ZVeSEVjM9kykublMZ8KJplDsF4DZ8A6 b5HgakNQrTDIAfWNORRnvGnHM7srgIbWV0pCKTkKT1STKQ7iOig2kcCfhiE9ZH9w1I2q gCZ9IjfOdg/ptLXPCFIjSqb5qnZrCS0Ruvnml0khCU8li4Bi9Fwrd5whfl7/1006eHFo 0X2L4H4pqBWJLk+UxppOr39iD+N0A3CApsJHMiyYYyiSapUg2sM33Ypzj5m8xrPgBlOA 0KGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si8934293otq.238.2020.03.03.13.39.23; Tue, 03 Mar 2020 13:39:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731312AbgCCSkp (ORCPT + 99 others); Tue, 3 Mar 2020 13:40:45 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:45149 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728787AbgCCSko (ORCPT ); Tue, 3 Mar 2020 13:40:44 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1j9CTA-0003Uu-LP; Tue, 03 Mar 2020 19:40:40 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id F00981C1A9F; Tue, 3 Mar 2020 19:40:39 +0100 (CET) Date: Tue, 03 Mar 2020 18:40:39 -0000 From: "tip-bot2 for Cyril Hrubis" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/urgent] sys/sysinfo: Respect boottime inside time namespace Cc: Cyril Hrubis , Thomas Gleixner , Dmitry Safonov , x86 , LKML In-Reply-To: <20200303150638.7329-1-chrubis@suse.cz> References: <20200303150638.7329-1-chrubis@suse.cz> MIME-Version: 1.0 Message-ID: <158326083954.28353.16922158200341050554.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the timers/urgent branch of tip: Commit-ID: ecc421e05bab97cf3ff4fe456ade47ef84dba8c2 Gitweb: https://git.kernel.org/tip/ecc421e05bab97cf3ff4fe456ade47ef84dba8c2 Author: Cyril Hrubis AuthorDate: Tue, 03 Mar 2020 16:06:38 +01:00 Committer: Thomas Gleixner CommitterDate: Tue, 03 Mar 2020 19:34:32 +01:00 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 --- kernel/sys.c | 2 ++ 1 file changed, 2 insertions(+) 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);