summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@mykernel.net>2021-03-10 10:09:25 +0800
committerMiklos Szeredi <mszeredi@redhat.com>2021-08-17 11:47:44 +0200
commitd8991e8622e758b718e2e4291d31dd0bea4e14a4 (patch)
treefa94c9693b9d500d1409e71c75a753f05295954d /fs/overlayfs
parentb71759ef1e1730db81dab98e9dab9455e8c7f5a2 (diff)
downloadlinux-d8991e8622e758b718e2e4291d31dd0bea4e14a4.tar.bz2
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')
-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: