]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
Use the correct clock for userspace time.
authorJustin Husted <sigstop@gmail.com>
Mon, 4 Nov 2019 23:34:02 +0000 (15:34 -0800)
committerJustin Husted <sigstop@gmail.com>
Tue, 5 Nov 2019 05:23:46 +0000 (21:23 -0800)
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 <sigstop@gmail.com>
include/linux/sched.h

index 4a7f8a0030854a77ee3cc1ee473cc25be58ba6e2..6edb06ef8a56abb2729f85000034f9dbc5af8aae 100644 (file)
@@ -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()