[Cluster-devel] [PATCH 2/2] gfs2: Initialize atime of I_NEW inodes

Andreas Gruenbacher agruenba at redhat.com
Mon Sep 26 17:54:19 UTC 2016


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 at redhat.com>
---
 fs/gfs2/inode.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index e4da0ec..fb3a810 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.7.4




More information about the Cluster-devel mailing list