From patchwork Wed Nov 25 15:22:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7700171 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A0D189F2EC for ; Wed, 25 Nov 2015 15:22:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C0C1B20752 for ; Wed, 25 Nov 2015 15:22:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EAF5E2073D for ; Wed, 25 Nov 2015 15:22:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752389AbbKYPWl (ORCPT ); Wed, 25 Nov 2015 10:22:41 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:60032 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752319AbbKYPWg (ORCPT ); Wed, 25 Nov 2015 10:22:36 -0500 Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue001) with ESMTPSA (Nemesis) id 0LwRR9-1aOo6n2gQR-018Mz6; Wed, 25 Nov 2015 16:22:26 +0100 From: Arnd Bergmann To: Alexander Viro , linux-fsdevel@vger.kernel.org, Andrew Morton Cc: Tina Ruchandani , y2038@lists.linaro.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, john.stultz@linaro.org Subject: [PATCH] coredump: Use 64bit time for unix time of coredump Date: Wed, 25 Nov 2015 16:22:25 +0100 Message-ID: <11690898.L9iAzJUgJU@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:/RsBL6WRjVyPs6/yr8mkYq4UblU1XApnOR9DMWaVv7KSFzgr/Er LKk+LqS7stl0te9Jpsk9GRfXq53ulX27iKAWrCKptrSIam6VB24tGotW8eH0EiivFCNO7zk N6l9S2ZpilLwizFqizitNn63fGuZhcNY0dIbeu+3fWPdHB0Qx7Qg/COZDcVOfukWPlJG2r3 I7QCik09FlAOzPDdH1d5A== X-UI-Out-Filterresults: notjunk:1; V01:K0:ATlOvWbLRg0=:SDZitZ5hTSHf/p/GmUC8Nc xpmex5QRcGyx2/YBFqqXmB1iZiZK7K2zZgg2Ya/deJjCjE6hOWFHPeqdC8AEvYXiTJJMb7fRy FfcnXhMPuu+P9IbncIkz3taWT00sx6O4GcgYAzbFfbN6qhESvlZKxIW9sGYLe5Fm7NsJvaTQU 7NzXPSN8J7zNSFNHqaWgVWIs58+w0JtVo7SfznnzpRCCpfKD+KVPsxBEzLUc957EoIsBlH1eH UiIhIm8yzpakwxSHp6vLXCVDy9URDFVrLHlBRfk1ebuSD53mpfdYD+oVrkSASSFWhRtWj7+th O1yiyYGAH5OFuoehhxly1hTcn4ZnCXnBWsxdPmVx7rSWMfyL19MtLBj1CH5nqMtrzgcFH9yVZ 5PiFhjhaczKBPfSCzXyxFblNjN1uyBKWe3WxdawSTl8QI0FolPA7Wp6hVd8uhYIKiZR5OnZVv EVni3veBHcguU7VcsmAQmbij+6Ta0HxU8sugYqBp44QCxMwwcaGS8E/NmjmHkcsfpXZRtgKcF 2ubUOrba0imLHstMHzOeTW16syNhb4QzSQ4Aa1XVdhMqOSg0zzhCtS76gSve2X8c01NnpsGxL +IcWjvV2pGiw5iIjM/BElklzbXsIM/b3VoKijxfzOi0xA6L4yxUtiw+Tb8v+q3X8hmtO6ikbk wLSGD3/63oCyU4+pd5Y4OWeJn8Xu9SIM/Mo3l/ratF3csXRw8MT3HdHxLxc4sbmVyDHpYPT3j HDMcDk//6jg0qKJC Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP struct timeval on 32-bit systems will have its tv_sec value overflow in year 2038 and beyond. Use a 64 bit value to print time of the coredump in seconds. ktime_get_real_seconds is chosen here for efficiency reasons. Suggested by: Arnd Bergmann Signed-off-by: Tina Ruchandani Signed-off-by: Arnd Bergmann --- I've had this patch in my queue for a while, and would like for someone to pick it up into mainline. Andrew Morton seems to be the one who has handled most of the coredump.c patches. Andrew, can you take this for 4.5? My tree is part of linux-next, so I assume I have to drop it before you can take it into -mm? Alternatively, Al could take it for his vfs tree, or Thomas or John for the timekeeping branch in tip. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/coredump.c b/fs/coredump.c index 1777331eee76..b3c153ca435d 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -232,9 +233,10 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm) break; /* UNIX time of coredump */ case 't': { - struct timeval tv; - do_gettimeofday(&tv); - err = cn_printf(cn, "%lu", tv.tv_sec); + time64_t time; + + time = ktime_get_real_seconds(); + err = cn_printf(cn, "%lld", time); break; } /* hostname */