From patchwork Mon Jun 18 15:03:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 138986 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4059108lji; Mon, 18 Jun 2018 08:03:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKuhl7dHMOaTw4fF1vLbJP0SRJcpxcpYN/5tTAbfPOjvdWYzhUv4MimqzA3A6usWfTvt9Mt X-Received: by 2002:a65:5306:: with SMTP id m6-v6mr11252926pgq.250.1529334234968; Mon, 18 Jun 2018 08:03:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529334234; cv=none; d=google.com; s=arc-20160816; b=c6P8sOhFtz8B9AwE3SXXycUR3IHe0DvzRA4Fm9KRi2jKO3+iMLYayEofBMTGH3eum5 cAXI3Oa0R/HQCMAjR2wmA6jfnm2wEtyRJdInSvMQ872wuTtpG+9zQOC7VnrD3Xhwf8aT OKwaRYdpDM4amex7IRV2ghWga3kTvnMrBCUsHUEVbvly1IkDHuZ7I5ScbqVa47c/GSig mNVTE6m4Z0KtErcpLsrnMSp0U/fj8+ocwG2Isb+zEi5XU4vOMjEEIkKEwvw2ex3v38O1 zLXtI+oPr7pkrku5+PW9GYMxJNKdt3uDJAAfJ/BP/IvVmFAXJVsxKkB8vGj8JgYCWP0R PvyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=kr4Fuch7n0FuPRprXaLdaziGGV/C/6eEFVMWaACYqkw=; b=JOhocb3lshxU+i5osbQIELcHSLDRSblwIquPyXt5f3yrhHBalT+4yS3zaozkFOio0y 7yCO73tpj3uVC78P4G577nsF3I2S//LqqNOalMWqB4HyhR3d+b+2OX3Gg42COM7l5Kr0 tGaTWw2aIL1tYPI6ySMLGCz1nryjWxQ3Azsy5K00Ffck1a9T5R58wKOLh7FMtZnkYXyY Lzpsy3l9yZcx7JzgOMVX1ozestjReh3scE9FdhT1HoYEmp+pGZqfy87Vc57BIcqPPcuV 6WSntyB784nEaExSV7LugFaurSbY13GcHqe0dQ7itNVPm2WD/VN1DXuMyt0V0qEA01lv IhDA== 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 t8-v6si15414729ply.15.2018.06.18.08.03.54; Mon, 18 Jun 2018 08:03:54 -0700 (PDT) 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 S964853AbeFRPDu (ORCPT + 30 others); Mon, 18 Jun 2018 11:03:50 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:45703 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934773AbeFRPDr (ORCPT ); Mon, 18 Jun 2018 11:03:47 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MXHhV-1fgjvF43y1-00WHyw; Mon, 18 Jun 2018 17:03:33 +0200 From: Arnd Bergmann To: Andrew Morton Cc: Arnd Bergmann , Dave Young , Xunlei Pang , Baoquan He , "Kirill A. Shutemov" , Petr Tesarik , Matthew Wilcox , =?utf-8?q?Marc-Andr?= =?utf-8?b?w6kgTHVyZWF1?= , linux-kernel@vger.kernel.org Subject: [PATCH] crash: print timestamp using time64_t Date: Mon, 18 Jun 2018 17:03:01 +0200 Message-Id: <20180618150329.941903-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:w03wT6vJO/pi4aWPc0WXIP4TcjBByuzb00xVaaJuA3rn4MLdVf/ xaVCZTxH57oPx2vGkE6ky/iSuy+KMp+pKnd+0JoImIuMvdlD/Aecqls5hWjXaOHQDS0JVFH h7Oprz57Nq0gchzfFLTPYUeNrzlcy0HOcczoNw+4jWXMVMV+Ss+yJXks3QckjlxW6a+Y2+p rlZ7PfRir27H6aU0Mfhuw== X-UI-Out-Filterresults: notjunk:1; V01:K0:XABJns4SUFo=:lFQpteQCeIeYoNgzxey6KU qTPcUC/AlL4eqae9kekqJTG8JGDMmA4aWu3NviJVtnPfH7B0y4KxIrwOnpsmw3cB+hGl2LFwG gVWanrfaNmV6pyDUNyNx3I4I1nWD0JTvMBvbjXeVHEqBghhwHFGXmxE1H1vmdVVapbNjRAbyn gvsbtC8CuNaxNhdZ6ug+VfFbFel7Lni24SSOSdiE18OysBkLctlqzlFVAakKGaTXgbDmXnOjB nnymZDLlKI7pYl5SIwWwofgxB4bMAW896Kp2qmoUvR0uPznYV0S19PyudUcCKdK7OR/sEBNB6 vajjuyXZE07KtxotOjhO71J0/LxSEVVJ5BaLy23V9oBWbWPga7xTKvKZWrFsP4DFP1a/eS2QN bIuL16ZhECUSv4O4Qqel1axi3O/ogk7eTZukpKSA+EBhczqgHqAmpdqM/kspqxmm2Ys8N8Qpe JhUJxbVLrXoWOhXwBWH9VXHfkIS72hGZBp+HQIxsmcgJfZg5xagDbqRXxxq/S505AQFG9VWjt IDxwI4mXH0QOArHkIJT6UHnxl+CRQ+rltkCRT/fKT6/cIgIWu4DrM2+daIYyCeYhK/9VEGpLH KnqWOICZSNfmS5nqKsqTicFc5wBxQ2wvmqEC+uIWnj9wTJ1htJRg0TqP3rCehHPCIkQujhkMk ZXuW2FMHyEB00uCZIvu323mJEuDV4CJiBOfhab/5lPViBtdmNR/wx3COzYICQLL8W6nQ= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The get_seconds() call returns a 32-bit timestamp on some architectures, and will overflow in the future. The newer ktime_get_real_seconds() always returns a 64-bit timestamp that does not suffer from this problem. Signed-off-by: Arnd Bergmann --- kernel/crash_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/kernel/crash_core.c b/kernel/crash_core.c index b66aced5e8c2..9612b2571bd6 100644 --- a/kernel/crash_core.c +++ b/kernel/crash_core.c @@ -344,7 +344,7 @@ void crash_save_vmcoreinfo(void) if (vmcoreinfo_data_safecopy) vmcoreinfo_data = vmcoreinfo_data_safecopy; - vmcoreinfo_append_str("CRASHTIME=%ld\n", get_seconds()); + vmcoreinfo_append_str("CRASHTIME=%lld\n", ktime_get_real_seconds()); update_vmcoreinfo_note(); }