From b0333de3fffb9b0365d51b7a9950a55bfcb4e313 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Fri, 17 Apr 2020 15:40:01 +0900 Subject: [PATCH] exfat: properly set s_time_gran The s_time_gran superblock field indicates the on-disk nanosecond granularity of timestamps, and for exfat that seems to be 10ms, so set s_time_gran to 10000000ns. Without this, in-memory timestamps change when they get re-read from disk. Signed-off-by: Eric Sandeen Signed-off-by: Namjae Jeon --- super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/super.c b/super.c index 71ae2bb339a4..bcc362dcb52a 100644 --- a/super.c +++ b/super.c @@ -762,7 +762,7 @@ static int exfat_fill_super(struct super_block *sb, void *data, int silent) sb->s_op = &exfat_sops; #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) - sb->s_time_gran = 1; + sb->s_time_gran = 10 * NSEC_PER_MSEC; sb->s_time_min = EXFAT_MIN_TIMESTAMP_SECS; sb->s_time_max = EXFAT_MAX_TIMESTAMP_SECS; #endif