ovl: update ctime when changing fileattr
authorChengguang Xu <cgxu519@mykernel.net>
Wed, 10 Mar 2021 02:09:25 +0000 (10:09 +0800)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 17 Aug 2021 09:47:44 +0000 (11:47 +0200)
Currently we keep size, mode and times of overlay inode
as the same as upper inode, so should update ctime when
changing file attribution as well.

Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/inode.c

index 8aa370e8143a750dcc241535bd92a6d48550d60e..7d52e5ef2ac74c2c23a82c46b94b2674a82bee3e 100644 (file)
@@ -573,6 +573,9 @@ int ovl_fileattr_set(struct user_namespace *mnt_userns,
                BUILD_BUG_ON(OVL_PROT_I_FLAGS_MASK & ~OVL_COPY_I_FLAGS_MASK);
                flags |= inode->i_flags & OVL_PROT_I_FLAGS_MASK;
                inode_set_flags(inode, flags, OVL_COPY_I_FLAGS_MASK);
+
+               /* Update ctime */
+               ovl_copyattr(ovl_inode_real(inode), inode);
        }
        ovl_drop_write(dentry);
 out: