gfs2: Initialize atime of I_NEW inodes
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 26 Sep 2016 18:24:34 +0000 (13:24 -0500)
committerBob Peterson <rpeterso@redhat.com>
Mon, 26 Sep 2016 18:24:34 +0000 (13:24 -0500)
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 <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/inode.c

index e0621cacf13483807a8169d75aea74a6c103afd8..095c839d44f4d7098dd846df2784a063acb5a443 100644 (file)
@@ -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);
        }