summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
diff options
context:
space:
mode:
authorArnd Bergmann2015-09-27 22:45:04 +0200
committerGreg Kroah-Hartman2015-09-29 04:03:33 +0200
commit65f28840e4c653b7d78feabcb65280c09d3d0d23 (patch)
tree30901aa488a42bc8d268b6d6ce744efb1b27935f /drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
parentstaging/lustre: obd: remove unused data structures (diff)
downloadkernel-qcow2-linux-65f28840e4c653b7d78feabcb65280c09d3d0d23.tar.gz
kernel-qcow2-linux-65f28840e4c653b7d78feabcb65280c09d3d0d23.tar.xz
kernel-qcow2-linux-65f28840e4c653b7d78feabcb65280c09d3d0d23.zip
staging/lustre: tracefile: document seconds overflow
The lustre tracefile has a timestamp defined as __u32 ph_sec; __u64 ph_usec; which seems completely backwards, as the microsecond portion of a time stamp will always fit into a __u32 value, while the second portion will overflow in 2038 or 2106 (in case of unsigned seconds). Changing this would unfortunately change the format in an incompatible way, breaking all existing user space tools that access the data. This uses ktime_get_real_ts64() to replace the insufficient do_gettimeofday() and then truncates the seconds portion to an u32 type, along with comments to explain the result. A possible alternative would be the use of ktime_get_ts64() to read a monotonic timestamp that never overflows, but this would trigger a check in user space 'hdr->ph_sec < (1 << 30)' that attempts to ensure that the values are within a reasonable range. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h')
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
index a3aa644154e2..a1787bb43483 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
@@ -73,6 +73,7 @@ struct ptldebug_header {
__u32 ph_mask;
__u16 ph_cpu_id;
__u16 ph_type;
+ /* time_t overflow in 2106 */
__u32 ph_sec;
__u64 ph_usec;
__u32 ph_stack;