Re: [PATCH] afs: use a consistent interpretation of time values

From: David Howells
Date: Wed Jun 20 2018 - 06:53:42 EST


Arnd Bergmann <arnd@xxxxxxxx> wrote:

> which avoids the y2038 overflow

No it doesn't. The AFS protocol is limited.

> + time64_t mtime_client; /* last time client changed data */
> + time64_t mtime_server; /* last time server changed data */
> ...
> - time_t creation; /* volume creation time */
> + time64_t creation; /* volume creation time */

Unless you can change the AFS protocol, this is a waste of memory. It might
be better to change them to u32 as they are protocol values rather than system
values.

> - inode->i_ctime.tv_sec = get_seconds();
> - inode->i_ctime.tv_nsec = 0;
> - inode->i_atime = inode->i_mtime = inode->i_ctime;
> + inode->i_ctime = inode->i_atime = inode->i_mtime = current_time(inode);

Surely, the tv_nsec should be zero since anything else cannot be represented
in the AFS protocol.

I will grant, however, I should be consistently using them as unsigned values.

Note that the answers to the above may change if and when I start supporting
the YFS protocol extensions, but for the AFS protocol, this is simply not
there.

David