aboutsummaryrefslogtreecommitdiffstats
path: root/fs/affs/super.c
diff options
context:
space:
mode:
authorDeepa Dinamani <deepa.kernel@gmail.com>2019-03-21 17:05:12 -0400
committerDeepa Dinamani <deepa.kernel@gmail.com>2019-08-30 10:27:18 -0400
commit487b25bc4be9c15a5edb81c4e52160b5e84d1c4f (patch)
treed4a8e515b4dc209dc530e244ccd6814813d4790e /fs/affs/super.c
parentc0da64f6bb674d20a8e84bcd30679c1483668fb2 (diff)
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 <deepa.kernel@gmail.com> Acked-by: David Sterba <dsterba@suse.com> Acked-by: Jeff Layton <jlayton@kernel.org> Cc: dsterba@suse.com
Diffstat (limited to 'fs/affs/super.c')
-rw-r--r--fs/affs/super.c4
1 files changed, 4 insertions, 0 deletions
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)
355 sb->s_op = &affs_sops; 355 sb->s_op = &affs_sops;
356 sb->s_flags |= SB_NODIRATIME; 356 sb->s_flags |= SB_NODIRATIME;
357 357
358 sb->s_time_gran = NSEC_PER_SEC;
359 sb->s_time_min = sys_tz.tz_minuteswest * 60 + AFFS_EPOCH_DELTA;
360 sb->s_time_max = 86400LL * U32_MAX + 86400 + sb->s_time_min;
361
358 sbi = kzalloc(sizeof(struct affs_sb_info), GFP_KERNEL); 362 sbi = kzalloc(sizeof(struct affs_sb_info), GFP_KERNEL);
359 if (!sbi) 363 if (!sbi)
360 return -ENOMEM; 364 return -ENOMEM;