On Thursday, August 11, 2016 4:49:22 PM CEST Loganaden Velvindron wrote:
> index c47b778..75e5e4f 100644
> --- a/fs/fuse/dir.c
> +++ b/fs/fuse/dir.c
> @@ -76,8 +76,8 @@ static u64 fuse_dentry_time(struct dentry *entry)
> static u64 time_to_jiffies(unsigned long sec, unsigned long nsec)
> {
> if (sec || nsec) {
> - struct timespec ts = {sec, nsec};
> - return get_jiffies_64() + timespec_to_jiffies(&ts);
> + struct timespec64 ts64 = {sec, nsec};
> + return get_jiffies_64() + timespec64_to_jiffies(&ts64);
The conversion looks correct, but aside from Julia's comment about the
patch description, I'd also change the subject line: it sounds like
this is the only problem in fuse, but it only addresses one aspect but
leaves the actual inode time stamps untouched.
Note that timespec64_to_jiffies returns an 'unsigned long', which will
also overflow on 32-bit architectures after 2^32 jiffies (a couple
of months depending on CONFIG_HZ). To be on the safe side, we could
instead open-code a simpler timespec64_to_jiffies() here and use
return get_jiffies_64() + sec * HZ + ((u32)nsec + TICK_NSEC - 1) /
TICK_NSEC;
Arnd
_______________________________________________
Y2038 mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/y2038