From ff695c5afb04ed619de5ff272f6b2bb2f00c209d Mon Sep 17 00:00:00 2001 From: Justin Husted Date: Mon, 4 Nov 2019 15:34:02 -0800 Subject: [PATCH] Use the correct clock for userspace time. The ktime_get_coarse_real_ts64() implementation for userspace was using CLOCK_MONOTONIC instead of CLOCK_REALTIME_COARSE. This resulted in files being timestamped with a time close to the unix epoch. Signed-off-by: Justin Husted --- include/linux/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 4a7f8a00..6edb06ef 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -149,7 +149,7 @@ static inline u64 ktime_get_real_seconds(void) static inline void ktime_get_coarse_real_ts64(struct timespec64 *ts) { - clock_gettime(CLOCK_MONOTONIC, ts); + clock_gettime(CLOCK_REALTIME_COARSE, ts); } #define current_kernel_time64() current_kernel_time()