From aeabe3d3e8b9c06bcdc6b7bbe07c930e4c5cee61 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Wed, 10 Feb 2021 14:25:17 +0800 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 Git-commit: 674a9985b8e35288225f2b67829a7dee3bf761da Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: lixiang --- fs/exfat/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/exfat/super.c b/fs/exfat/super.c index c40cdf6949bd..08d3317553ec 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -535,7 +535,7 @@ static int exfat_fill_super(struct super_block *sb, struct fs_context *fc) sb->s_magic = EXFAT_SUPER_MAGIC; sb->s_op = &exfat_sops; - 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;