diff mbox series

[1/2] exfat: properly set s_time_gran

Message ID 5535c58b-aac1-274e-a0bb-6333b33365d1@sandeen.net (mailing list archive)
State New, archived
Headers show
Series exfat: timestamp fixes | expand

Commit Message

Eric Sandeen April 16, 2020, 1:09 a.m. UTC
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 <sandeen@sandeen.net>
---

Comments

Matthew Wilcox April 19, 2020, 3:15 a.m. UTC | #1
On Wed, Apr 15, 2020 at 08:09:11PM -0500, Eric Sandeen wrote:
> -	sb->s_time_gran = 1;
> +	sb->s_time_gran = 10000000;

10 * NSEC_PER_MSEC?
Namjae Jeon April 20, 2020, 11:28 p.m. UTC | #2
> 
> On Wed, Apr 15, 2020 at 08:09:11PM -0500, Eric Sandeen wrote:
> > -	sb->s_time_gran = 1;
> > +	sb->s_time_gran = 10000000;
> 
> 10 * NSEC_PER_MSEC?
Looks cleaner.
Thanks!
diff mbox series

Patch

diff --git a/fs/exfat/super.c b/fs/exfat/super.c
index 16ed202ef527..4f21bf8b550d 100644
--- a/fs/exfat/super.c
+++ b/fs/exfat/super.c
@@ -541,7 +542,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 = 10000000;
 	sb->s_time_min = EXFAT_MIN_TIMESTAMP_SECS;
 	sb->s_time_max = EXFAT_MAX_TIMESTAMP_SECS;