Skip to contentSkip to conversation

crash: print timestamp using time64_t

PATCH New Arnd Bergmann 1 participant 1 message Jun 18, 2018 Kdump

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crash: print timestamp using time64_t

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.

---
 kernel/crash_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/crash_core.c +1 -1
index b66aced5e8c2..9612b2571bd6 100644
@@ -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();
 }
 
Signature · 1 line
2.9.0