From patchwork Mon Jun 20 20:00:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102126 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1677571qgy; Mon, 20 Jun 2016 13:06:08 -0700 (PDT) X-Received: by 10.98.89.85 with SMTP id n82mr23248517pfb.23.1466453168506; Mon, 20 Jun 2016 13:06:08 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si35036852pfa.18.2016.06.20.13.06.08; Mon, 20 Jun 2016 13:06:08 -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 S932647AbcFTUGG (ORCPT + 30 others); Mon, 20 Jun 2016 16:06:06 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:51785 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932134AbcFTUFx (ORCPT ); Mon, 20 Jun 2016 16:05:53 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0Ldhgp-1bgTjP1OcN-00iy69; Mon, 20 Jun 2016 21:58:40 +0200 From: Arnd Bergmann To: Jens Axboe Cc: y2038@lists.linaro.org, Arnd Bergmann , Jeff Moyer , Steven Rostedt , Ingo Molnar , Hannes Reinecke , Mike Christie , Shaohua Li , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] blktrace: reword comment about time overflow Date: Mon, 20 Jun 2016 22:00:12 +0200 Message-Id: <20160620200040.2813298-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:7Cokgd1yLGmpPGwn6heXTpdqWqh2o1D90Qez6Zoia6ZnTjp812Q r/LYrHE/zmORFaV1yXfJfKHFhQvqdVOR+1Jej5cUWRGzA9Xye3tq2LlBC9rKSJeF9nqQ1+W PZKMM129kxs1In7sCIXkRPzSS/yfys4OOrGu3vua7Xjn4C/Uo1yMr4C2vwIPXAVCPvESMId Do94jhU2ev9Kfy6KEjrlg== X-UI-Out-Filterresults: notjunk:1; V01:K0:51zvFtVrfUs=:/BF7nhlb3TDGHCiACnzE3P CeN5IcTnjOFevVqwLEL7FMjPsr6838zHmu6lo7rhBMXPbxYZAOS0FWT7AuFCRr0oizVV+hp2Z T2GWTXkdZHopBzP7cy1bvsjLUg5a8957dgu2E7sMqvVe8fHzCiTIgDTmkMGe7NQVyepR6Laz0 uWZFYGuV3GILUSklwuJ6cl9nYwkjOH9A8rz5hydE2RgaQa46m13lhmk1g+LR7ZU3pfVzZ3aut iadpMn1V9PRsC6wDI25AvofvmAqguhvoGxgrgSgCskWAeB+WV2Do9Be4boJdmZ3bpcXHuLEA1 BmxxQmgP63lWFj+ILYSE0V5h/PLNSYpNj7qnRTbY9boZfmHddZoXpCjsFV7qk836m0vabNBoB tKqaBOhpIslS/YAr2mSC31ioubbatLCuSBq8IdbR2t1y0hici7xAN0S2gsPZktwouMu71zRxV /PGema9tSNu6OOTVPbPXyYYUbAKBlgWmjbM7quVTVuFDsWUkQTjfqplliEjFUshxot0p0Adn9 ThPh6DoW6eLzVkmkYhsJQMVzCCSX16B49e+95AloUCA5DHofm4E3i9jVSjJtxYhMP2pNBPjPa RUnGO8igSYRh6eFHfysO2O8MCYJBR0UIoTsaNDZcP9jCNr5iC/zQNc3DmrQbWRvrRBaQn4bn5 XDg5PoKNm0dusWLKRXAIoPBhUgVyykOkfB6/ju+yU0OE9gGkLdEJWoIiPWQqebzMHAKE= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jeff Moyer looked up the blktrace source to see if an overflow might happen. The situation is as follows: - The time stamp is not used by the program itself, only for printing human-readable output. - We normally don't print the timestamp at all, except when an undocumented format option is given to blkparse. - The assumption is that no other program besides blktrace even looks at this data, but of course cannot be sure. - On 64-bit systems, the time gets read from the unsigned 32-bit kernel structure into a timespec in a way that will work correctly until 2106, so there is no 2038 problem. - On 32-bit systems that have a new (future) libc build with a 64-bit time_t type, it will work the same way. - On current 32-bit systems, the time is passed into localtime(), at which point the overflow happens, but those systems are already broken. In short, it's good enough for now, so update the comment. Signed-off-by: Arnd Bergmann Fixes: 59a37f8baeb2 ("blktrace: avoid using timespec") Cc: Jeff Moyer --- kernel/trace/blktrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.9.0 diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index b0816e4a61a5..4a3666779589 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -131,7 +131,8 @@ static void trace_note_time(struct blk_trace *bt) unsigned long flags; u32 words[2]; - /* need to check user space to see if this breaks in y2038 or y2106 */ + /* blktrace converts this to a time_t and will overflow in + 2106, not in 2038 */ ktime_get_real_ts64(&now); words[0] = (u32)now.tv_sec; words[1] = now.tv_nsec;