summaryrefslogtreecommitdiff
path: root/fs/autofs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2023-06-12 06:45:19 -0400
committerChristian Brauner <brauner@kernel.org>2023-06-15 09:22:24 +0200
commit797a1d894d7b7586f422cabf8d7807cd39d0b5aa (patch)
tree8e43ec3090477c58a45da9bb83136ad7daa69009 /fs/autofs
parent33d8b5d7824c7175ed968b8e89e6db3566e9c177 (diff)
downloadlwn-797a1d894d7b7586f422cabf8d7807cd39d0b5aa.tar.gz
lwn-797a1d894d7b7586f422cabf8d7807cd39d0b5aa.zip
autofs: set ctime as well when mtime changes on a dir
When adding entries to a directory, POSIX generally requires that the ctime also be updated alongside the mtime. Signed-off-by: Jeff Layton <jlayton@kernel.org> Acked-by: Ian Kent <raven@themaw.net> Message-Id: <20230612104524.17058-4-jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/autofs')
-rw-r--r--fs/autofs/root.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/autofs/root.c b/fs/autofs/root.c
index 6baf90b08e0e..93046c9dc461 100644
--- a/fs/autofs/root.c
+++ b/fs/autofs/root.c
@@ -600,7 +600,7 @@ static int autofs_dir_symlink(struct mnt_idmap *idmap,
p_ino = autofs_dentry_ino(dentry->d_parent);
p_ino->count++;
- dir->i_mtime = current_time(dir);
+ dir->i_mtime = dir->i_ctime = current_time(dir);
return 0;
}
@@ -633,7 +633,7 @@ static int autofs_dir_unlink(struct inode *dir, struct dentry *dentry)
d_inode(dentry)->i_size = 0;
clear_nlink(d_inode(dentry));
- dir->i_mtime = current_time(dir);
+ dir->i_mtime = dir->i_ctime = current_time(dir);
spin_lock(&sbi->lookup_lock);
__autofs_add_expiring(dentry);
@@ -749,7 +749,7 @@ static int autofs_dir_mkdir(struct mnt_idmap *idmap,
p_ino = autofs_dentry_ino(dentry->d_parent);
p_ino->count++;
inc_nlink(dir);
- dir->i_mtime = current_time(dir);
+ dir->i_mtime = dir->i_ctime = current_time(dir);
return 0;
}