Unionfs: initialize inode times for reused inodes
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 25 Dec 2007 22:01:40 +0000 (17:01 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 25 Dec 2007 22:01:40 +0000 (17:01 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/super.c

index 99ec8d2be06c4e92da128903741ff3e871900541..70eb9d5393cbcc4018399f24f89ad9354fb61c0f 100644 (file)
@@ -55,6 +55,14 @@ static void unionfs_read_inode(struct inode *inode)
 
        inode->i_mapping->a_ops = &unionfs_aops;
 
+       /*
+        * reset times so unionfs_copy_attr_all can keep out time invariants
+        * right (upper inode time being the max of all lower ones).
+        */
+       inode->i_atime.tv_sec = inode->i_atime.tv_nsec = 0;
+       inode->i_mtime.tv_sec = inode->i_mtime.tv_nsec = 0;
+       inode->i_ctime.tv_sec = inode->i_ctime.tv_nsec = 0;
+
        unionfs_read_unlock(inode->i_sb);
 }