summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/inode.c
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@mykernel.net>2021-03-10 03:09:25 +0100
committerMiklos Szeredi <mszeredi@redhat.com>2021-08-17 11:47:44 +0200
commitd8991e8622e758b718e2e4291d31dd0bea4e14a4 (patch)
treefa94c9693b9d500d1409e71c75a753f05295954d /fs/overlayfs/inode.c
parentovl: skip checking lower file's i_writecount on truncate (diff)
downloadlinux-d8991e8622e758b718e2e4291d31dd0bea4e14a4.tar.xz
linux-d8991e8622e758b718e2e4291d31dd0bea4e14a4.zip
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 <cgxu519@mykernel.net> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/inode.c')
-rw-r--r--fs/overlayfs/inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index 8aa370e8143a..7d52e5ef2ac7 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: