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:
@@ -375,7 +375,7 @@ affs_secs_to_datestamp(time64_t secs, struct affs_date *ds)
|
||||
u32 minute;
|
||||
s32 rem;
|
||||
|
||||
secs -= sys_tz.tz_minuteswest * 60 + ((8 * 365 + 2) * 24 * 60 * 60);
|
||||
secs -= sys_tz.tz_minuteswest * 60 + AFFS_EPOCH_DELTA;
|
||||
if (secs < 0)
|
||||
secs = 0;
|
||||
days = div_s64_rem(secs, 86400, &rem);
|
||||
|
Reference in New Issue
Block a user