From 487b25bc4be9c15a5edb81c4e52160b5e84d1c4f Mon Sep 17 00:00:00 2001 From: Deepa Dinamani Date: Thu, 21 Mar 2019 14:05:12 -0700 Subject: fs: affs: Initialize filesystem timestamp ranges Fill in the appropriate limits to avoid inconsistencies in the vfs cached inode times when timestamps are outside the permitted range. Also fix timestamp calculation to avoid overflow while converting from days to seconds. Signed-off-by: Deepa Dinamani Acked-by: David Sterba Acked-by: Jeff Layton Cc: dsterba@suse.com --- fs/affs/super.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/affs/super.c') diff --git a/fs/affs/super.c b/fs/affs/super.c index e7d036efbaa1..cc463ae47c12 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c @@ -355,6 +355,10 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent) sb->s_op = &affs_sops; sb->s_flags |= SB_NODIRATIME; + sb->s_time_gran = NSEC_PER_SEC; + sb->s_time_min = sys_tz.tz_minuteswest * 60 + AFFS_EPOCH_DELTA; + sb->s_time_max = 86400LL * U32_MAX + 86400 + sb->s_time_min; + sbi = kzalloc(sizeof(struct affs_sb_info), GFP_KERNEL); if (!sbi) return -ENOMEM; -- cgit v1.2.3