ext4: use ktime_get_real_seconds for i_dtime
authorArnd Bergmann <[email protected]>
Sun, 29 Jul 2018 19:50:00 +0000 (15:50 -0400)
committerTheodore Ts'o <[email protected]>
Sun, 29 Jul 2018 19:50:00 +0000 (15:50 -0400)
We only care about the low 32-bit for i_dtime as explained in commit
b5f515735bea ("ext4: avoid Y2038 overflow in recently_deleted()"), so
the use of get_seconds() is correct here, but that function is getting
removed in the process of the y2038 fixes, so let's use the modern
ktime_get_real_seconds() here.

Reviewed-by: Andreas Dilger <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
fs/ext4/inode.c

index 4efe77286ecd55a6a1c79e45e61a93eb3554b901..ba0de19fb1ad12953e37939f8917d325f0ab0039 100644 (file)
@@ -317,7 +317,7 @@ stop_handle:
         * (Well, we could do this if we need to, but heck - it works)
         */
        ext4_orphan_del(handle, inode);
-       EXT4_I(inode)->i_dtime  = get_seconds();
+       EXT4_I(inode)->i_dtime  = (__u32)ktime_get_real_seconds();
 
        /*
         * One subtle ordering requirement: if anything has gone wrong