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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user