Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1426985
| Path | csiph.com!feeder.erje.net!1.us.feeder.erje.net!goblin1!goblin.stu.neva.ru!newsfeed.datemas.de!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Arnd Bergmann <arnd@arndb.de> |
| Newsgroups | linux.kernel |
| Subject | [PATCH] blktrace: reword comment about time overflow |
| Date | Mon, 20 Jun 2016 22:10:02 +0200 |
| Message-ID | <rMdGa-4no-9@gated-at.bofh.it> (permalink) |
| 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 | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 43 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | y2038@lists.linaro.org, Arnd Bergmann <arnd@arndb.de>, Jeff Moyer <jmoyer@redhat.com>, Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@redhat.com>, Hannes Reinecke <hare@suse.com>, Mike Christie <mchristi@redhat.com>, Shaohua Li <shli@fb.com>, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org |
| X-Original-Date | Mon, 20 Jun 2016 22:00:12 +0200 |
| X-Original-Message-ID | <20160620200040.2813298-1-arnd@arndb.de> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1426985 |
Show key headers only | View raw
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 <arnd@arndb.de>
Fixes: 59a37f8baeb2 ("blktrace: avoid using timespec")
Cc: Jeff Moyer <jmoyer@redhat.com>
---
kernel/trace/blktrace.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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;
--
2.9.0
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] blktrace: reword comment about time overflow Arnd Bergmann <arnd@arndb.de> - 2016-06-20 22:10 +0200 Re: [PATCH] blktrace: reword comment about time overflow Jeff Moyer <jmoyer@redhat.com> - 2016-06-20 22:50 +0200
csiph-web