From 332f51d7db13ffb7fcbe2407ed5b3667bc3750a7 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Mon, 26 Sep 2016 13:24:34 -0500 Subject: [PATCH] gfs2: Initialize atime of I_NEW inodes Fix for commit 719ee344: initialize atime of I_NEW inodes to 0 so that the timestamps read from disk will always be more recent than the initial timestamp, and the atime in the I_NEW inode will be set correctly. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson --- fs/gfs2/inode.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index e0621cacf134..095c839d44f4 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -187,6 +187,10 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type, } gfs2_set_iop(inode); + + inode->i_atime.tv_sec = 0; + inode->i_atime.tv_nsec = 0; + unlock_new_inode(inode); } -- 2.39.5