Commit fb91816e authored by Jeff Layton's avatar Jeff Layton Committed by Christian Brauner

exfat: ensure that ctime is updated whenever the mtime is

When removing entries from a directory, the ctime must also be updated
alongside the mtime.
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Message-Id: <20230705190309.579783-4-jlayton@kernel.org>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 73e67306
......@@ -817,7 +817,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry)
ei->dir.dir = DIR_DELETED;
inode_inc_iversion(dir);
dir->i_mtime = dir->i_atime = current_time(dir);
dir->i_mtime = dir->i_atime = dir->i_ctime = current_time(dir);
exfat_truncate_atime(&dir->i_atime);
if (IS_DIRSYNC(dir))
exfat_sync_inode(dir);
......@@ -825,7 +825,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry)
mark_inode_dirty(dir);
clear_nlink(inode);
inode->i_mtime = inode->i_atime = current_time(inode);
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
exfat_truncate_atime(&inode->i_atime);
exfat_unhash_inode(inode);
exfat_d_version_set(dentry, inode_query_iversion(dir));
......@@ -979,7 +979,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry)
ei->dir.dir = DIR_DELETED;
inode_inc_iversion(dir);
dir->i_mtime = dir->i_atime = current_time(dir);
dir->i_mtime = dir->i_atime = dir->i_ctime = current_time(dir);
exfat_truncate_atime(&dir->i_atime);
if (IS_DIRSYNC(dir))
exfat_sync_inode(dir);
......@@ -988,7 +988,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry)
drop_nlink(dir);
clear_nlink(inode);
inode->i_mtime = inode->i_atime = current_time(inode);
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
exfat_truncate_atime(&inode->i_atime);
exfat_unhash_inode(inode);
exfat_d_version_set(dentry, inode_query_iversion(dir));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment