From: Chengguang Xu Date: Wed, 10 Mar 2021 02:09:25 +0000 (+0800) Subject: ovl: update ctime when changing fileattr X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d8991e8622e758b718e2e4291d31dd0bea4e14a4;p=linux.git ovl: update ctime when changing fileattr 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 Signed-off-by: Miklos Szeredi --- diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 8aa370e8143a7..7d52e5ef2ac74 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -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: