From ad7f6f0ce2838257bcb066fcf41d942b030f95f8 Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Tue, 18 Dec 2007 01:06:30 -0500 Subject: [PATCH] Unionfs: initialize inode times for reused inodes Signed-off-by: Erez Zadok --- fs/unionfs/super.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c index ed3eb0460fe..c474c8624b6 100644 --- a/fs/unionfs/super.c +++ b/fs/unionfs/super.c @@ -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); } -- 2.43.0