Skip to contentSkip to conversation

ovl: update ctime when changing file attribution

PATCH In review Chengguang Xu 2 participants 2 messages Mar 10, 2021 – Jul 21, 2021 Overlay filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ovl: update ctime when changing file attribution

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.

---
 fs/overlayfs/file.c | 2 ++
 1 file changed, 2 insertions(+)
fs/overlayfs/file.c +2 -0
index dbfb35fb0ff7..49b73a2e92a7 100644
@@ -546,6 +546,8 @@ static long ovl_ioctl_set_flags(struct file *file, unsigned int cmd,
 	ret = ovl_real_ioctl(file, cmd, arg);
 
 	ovl_copyflags(ovl_inode_real(inode), inode);
+	/* Update ctime */
+	ovl_copyattr(ovl_inode_real(inode), inode);
 unlock:
 	inode_unlock(inode);
 
Signature · 1 line
2.27.0
maintainer
#1 lore raw
Quoted 4 lines · Chengguang Xu

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.

Updated and pushed.

Thanks,
Miklos

Quoted 23 lines
---
 fs/overlayfs/file.c | 2 ++
 1 file changed, 2 insertions(+)
fs/overlayfs/file.c +2 -1
index dbfb35fb0ff7..49b73a2e92a7 100644
@@ -546,6 +546,8 @@ static long ovl_ioctl_set_flags(struct file *file, unsigned int cmd,
        ret = ovl_real_ioctl(file, cmd, arg);
 
        ovl_copyflags(ovl_inode_real(inode), inode);
+       /* Update ctime */
+       ovl_copyattr(ovl_inode_real(inode), inode);
 unlock:
        inode_unlock(inode);
 
--

2.27.0