Many time_t issues in filesystems is involved with VFS i_mtime/i_ctime. for example:
static void hpfs_update_directory_times(struct inode *dir) { - time_t t = get_seconds(); + time64_t t = ktime_get_real_seconds(); - if (t == dir->i_mtime.tv_sec && - t == dir->i_ctime.tv_sec) + if ((time_t)t == dir->i_mtime.tv_sec && + (time_t)t == dir->i_ctime.tv_sec) return; Can I replace get_seconds with ktime_get_real_seconds first, and do a 64_to_32 cast so as to be compatible with VFS i_mtime/i_ctime like above? Or just leave all the stuff which is involved with VFS i_mtime/i_ctime until then change of generic VFS code.
Arnd Bergmann arnd@arndb.de
2015-11-12 21:29 To y2038@lists.linaro.org, cc DengChao chao.deng@linaro.org Subject Re: [Y2038] [PATCH 1/2] fs:hpfs:Remove internal using time_t
On Thursday 12 November 2015 21:26:02 DengChao wrote:
static void hpfs_update_directory_times(struct inode *dir) {
time_t t = get_seconds();
time64_t t = ktime_get_real_seconds(); if (t == dir->i_mtime.tv_sec && t == dir->i_ctime.tv_sec) return;
It's too early for this change, as the i_mtime and i_ctime fields are still using time_t. We first have to change the generic VFS code.
Arnd