summaryrefslogtreecommitdiff
path: root/fs/affs/inode.c
diff options
context:
space:
mode:
authorDeepa Dinamani <deepa.kernel@gmail.com>2019-03-22 00:05:12 +0300
committerDeepa Dinamani <deepa.kernel@gmail.com>2019-08-30 17:27:18 +0300
commit487b25bc4be9c15a5edb81c4e52160b5e84d1c4f (patch)
treed4a8e515b4dc209dc530e244ccd6814813d4790e /fs/affs/inode.c
parentc0da64f6bb674d20a8e84bcd30679c1483668fb2 (diff)
downloadlinux-487b25bc4be9c15a5edb81c4e52160b5e84d1c4f.tar.xz
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/inode.c')
-rw-r--r--fs/affs/inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/affs/inode.c b/fs/affs/inode.c
index 73598bff8506..a346cf7659f1 100644
--- a/fs/affs/inode.c
+++ b/fs/affs/inode.c
@@ -150,10 +150,10 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino)
}
inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode->i_ctime.tv_sec
- = (be32_to_cpu(tail->change.days) * (24 * 60 * 60) +
+ = (be32_to_cpu(tail->change.days) * 86400LL +
be32_to_cpu(tail->change.mins) * 60 +
be32_to_cpu(tail->change.ticks) / 50 +
- ((8 * 365 + 2) * 24 * 60 * 60)) +
+ AFFS_EPOCH_DELTA) +
sys_tz.tz_minuteswest * 60;
inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = inode->i_atime.tv_nsec = 0;
affs_brelse(bh);