fs: use timespec64 in relatime_need_update
diff mbox series

Message ID 20190426145053.2137025-1-arnd@arndb.de
State New
Headers show
Series
  • fs: use timespec64 in relatime_need_update
Related show

Commit Message

Arnd Bergmann April 26, 2019, 2:50 p.m. UTC
For some reason, the conversion of the VFS code away from 'struct timespec'
left one function behind that still uses it, for absolutely no reason.

Using timespec64 will make the atime update logic work correctly past
y2038.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Al Viro April 26, 2019, 3:17 p.m. UTC | #1
On Fri, Apr 26, 2019 at 04:50:41PM +0200, Arnd Bergmann wrote:
> For some reason, the conversion of the VFS code away from 'struct timespec'
> left one function behind that still uses it, for absolutely no reason.
> 
> Using timespec64 will make the atime update logic work correctly past
> y2038.

Applied.

Patch
diff mbox series

diff --git a/fs/inode.c b/fs/inode.c
index e9d97add2b36..f8ed7144c3dd 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1601,7 +1601,7 @@  EXPORT_SYMBOL(bmap);
  * passed since the last atime update.
  */
 static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
-			     struct timespec now)
+			     struct timespec64 now)
 {
 
 	if (!(mnt->mnt_flags & MNT_RELATIME))
@@ -1702,7 +1702,7 @@  bool atime_needs_update(const struct path *path, struct inode *inode)
 
 	now = current_time(inode);
 
-	if (!relatime_need_update(mnt, inode, timespec64_to_timespec(now)))
+	if (!relatime_need_update(mnt, inode, now))
 		return false;
 
 	if (timespec64_equal(&inode->i_atime, &now))