diff mbox series

ocfs2: update inode ctime in ocfs2_fileattr_set

Message ID 20240318115609.3194-1-l@damenly.org (mailing list archive)
State New, archived
Headers show
Series ocfs2: update inode ctime in ocfs2_fileattr_set | expand

Commit Message

Su Yue March 18, 2024, 11:56 a.m. UTC
From: Su Yue <glass.su@suse.com>

inode ctime should be updated if ocfs2_fileattr_set is called.

Signed-off-by: Su Yue <glass.su@suse.com>
---
 fs/ocfs2/ioctl.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Joseph Qi March 19, 2024, 1:43 a.m. UTC | #1
On 3/18/24 7:56 PM, Su Yue wrote:
> From: Su Yue <glass.su@suse.com>
> 
> inode ctime should be updated if ocfs2_fileattr_set is called.
> 
> Signed-off-by: Su Yue <glass.su@suse.com>

Looks fine.
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>

> ---
>  fs/ocfs2/ioctl.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
> index b1550ba73f96..71beef7f8a60 100644
> --- a/fs/ocfs2/ioctl.c
> +++ b/fs/ocfs2/ioctl.c
> @@ -125,6 +125,7 @@ int ocfs2_fileattr_set(struct mnt_idmap *idmap,
>  
>  	ocfs2_inode->ip_attr = flags;
>  	ocfs2_set_inode_flags(inode);
> +	inode_set_ctime_current(inode);
>  
>  	status = ocfs2_mark_inode_dirty(handle, inode, bh);
>  	if (status < 0)
diff mbox series

Patch

diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index b1550ba73f96..71beef7f8a60 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -125,6 +125,7 @@  int ocfs2_fileattr_set(struct mnt_idmap *idmap,
 
 	ocfs2_inode->ip_attr = flags;
 	ocfs2_set_inode_flags(inode);
+	inode_set_ctime_current(inode);
 
 	status = ocfs2_mark_inode_dirty(handle, inode, bh);
 	if (status < 0)