On Wed, Aug 26, 2015 at 03:12:03PM -0700, Andrew Morton wrote:
> From: Tina Ruchandani <ruchandani.t...@gmail.com>
> Subject: ocfs2: use 64bit variables to track heartbeat time
> 
> o2hb_elapsed_msecs computes the time taken for a disk heartbeat.  'struct
> timeval' variables are used to store start and end times.  On 32-bit
> systems, the 'tv_sec' component of 'struct timeval' will overflow in year
> 2038 and beyond.
> 
> This patch solves the overflow with the following:
> 
> 1. Replace o2hb_elapsed_msecs using 'ktime_t' values to measure start
>    and end time, and built-in function 'ktime_ms_delta' to compute the
>    elapsed time.  ktime_get_real() is used since the code prints out the
>    wallclock time.
> 
> 2. Changes format string to print time as a single 64-bit nanoseconds
>    value ("%lld") instead of seconds and microseconds.  This simplifies
>    the code since converting ktime_t to that format would need expensive
>    computation.  However, the debug log string is less readable than the
>    previous format.
> 
> Signed-off-by: Tina Ruchandani <ruchandani.t...@gmail.com>
> Suggested by: Arnd Bergmann <a...@arndb.de>
> Cc: Mark Fasheh <mfas...@suse.com>
> Cc: Joel Becker <jl...@evilplan.org>
> Signed-off-by: Andrew Morton <a...@linux-foundation.org>

Reviewed-by: Mark Fasheh <mfas...@suse.de>

--
Mark Fasheh

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

Reply via email to