Skip to content

Commit

Permalink
kernel/crash_core.c: print timestamp using time64_t
Browse files Browse the repository at this point in the history
The get_seconds() call returns a 32-bit timestamp on some architectures,
and will overflow in the future.  The newer ktime_get_real_seconds()
always returns a 64-bit timestamp that does not suffer from this problem.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnd Bergmann <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Dave Young <[email protected]>
Cc: Baoquan He <[email protected]>
Cc: "Kirill A. Shutemov" <[email protected]>
Cc: Petr Tesarik <[email protected]>
Cc: Marc-Andr Lureau <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
arndb authored and torvalds committed Aug 22, 2018
1 parent 2035839 commit 91bc9aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/crash_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void crash_save_vmcoreinfo(void)
if (vmcoreinfo_data_safecopy)
vmcoreinfo_data = vmcoreinfo_data_safecopy;

vmcoreinfo_append_str("CRASHTIME=%ld\n", get_seconds());
vmcoreinfo_append_str("CRASHTIME=%lld\n", ktime_get_real_seconds());
update_vmcoreinfo_note();
}

Expand Down

0 comments on commit 91bc9aa

Please sign in to comment.