Re: [Y2038] [PATCH 1/2] fs:hpfs:Remove internal using time_t

2015-11-17 Thread Deepa Dinamani


> On Nov 17, 2015, at 1:07 AM, Arnd Bergmann  wrote:
> 
>> On Tuesday 17 November 2015 17:04:42 deng.ch...@zte.com.cn wrote:
>> 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.
> 
> Better just leave it alone for now. Deepa is looking into the
> VFS changes, and I think it will make her work easier that way.
> 
Yes, I'm looking at vfs.
I haven't decided what to do with this yet. Let's leave it as is for now.

-Deepa
___
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038


Re: [Y2038] [PATCH 1/2] fs:hpfs:Remove internal using time_t

2015-11-17 Thread Arnd Bergmann
On Tuesday 17 November 2015 17:04:42 deng.ch...@zte.com.cn wrote:
> 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.
> 

Better just leave it alone for now. Deepa is looking into the
VFS changes, and I think it will make her work easier that way.

Arnd
___
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038


Re: [Y2038] [PATCH 1/2] fs:hpfs:Remove internal using time_t

2015-11-17 Thread deng . chao1
  y2038@lists.linaro.org,   





  









   cc 



  DengChao





  









  Subject 



                  Re: [Y2038] [PATCH 1/2] 
fs:hpfs:

Re: [Y2038] [PATCH 1/2] fs:hpfs:Remove internal using time_t

2015-11-12 Thread Arnd Bergmann
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
___
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038


[Y2038] [PATCH 1/2] fs:hpfs:Remove internal using time_t

2015-11-12 Thread DengChao
The hpfs code uses "get_seconds()" and "time_t", this will cause
problems on 32-bit architectures in 2038 when time_t overflows.
This patch replaces "get_seconds()" and "time_t" with
"ktime_get_real_seconds()" and "time64_t".

Signed-off-by: DengChao 
---
 fs/hpfs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c
index 9e92c9c..9fcb6f0 100644
--- a/fs/hpfs/namei.c
+++ b/fs/hpfs/namei.c
@@ -10,7 +10,7 @@
 
 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;
-- 
1.9.1

___
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038