Skip to content

Commit 797a1d8

Browse files
jtlaytonbrauner
authored andcommitted
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 <[email protected]> Acked-by: Ian Kent <[email protected]> Message-Id: <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 33d8b5d commit 797a1d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/autofs/root.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ static int autofs_dir_symlink(struct mnt_idmap *idmap,
600600
p_ino = autofs_dentry_ino(dentry->d_parent);
601601
p_ino->count++;
602602

603-
dir->i_mtime = current_time(dir);
603+
dir->i_mtime = dir->i_ctime = current_time(dir);
604604

605605
return 0;
606606
}
@@ -633,7 +633,7 @@ static int autofs_dir_unlink(struct inode *dir, struct dentry *dentry)
633633
d_inode(dentry)->i_size = 0;
634634
clear_nlink(d_inode(dentry));
635635

636-
dir->i_mtime = current_time(dir);
636+
dir->i_mtime = dir->i_ctime = current_time(dir);
637637

638638
spin_lock(&sbi->lookup_lock);
639639
__autofs_add_expiring(dentry);
@@ -749,7 +749,7 @@ static int autofs_dir_mkdir(struct mnt_idmap *idmap,
749749
p_ino = autofs_dentry_ino(dentry->d_parent);
750750
p_ino->count++;
751751
inc_nlink(dir);
752-
dir->i_mtime = current_time(dir);
752+
dir->i_mtime = dir->i_ctime = current_time(dir);
753753

754754
return 0;
755755
}

0 commit comments

Comments
 (0)