Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jeff Layton and committed by
Christian Brauner
797a1d89 33d8b5d7

+3 -3
+3 -3
fs/autofs/root.c
··· 600 600 p_ino = autofs_dentry_ino(dentry->d_parent); 601 601 p_ino->count++; 602 602 603 - dir->i_mtime = current_time(dir); 603 + dir->i_mtime = dir->i_ctime = current_time(dir); 604 604 605 605 return 0; 606 606 } ··· 633 633 d_inode(dentry)->i_size = 0; 634 634 clear_nlink(d_inode(dentry)); 635 635 636 - dir->i_mtime = current_time(dir); 636 + dir->i_mtime = dir->i_ctime = current_time(dir); 637 637 638 638 spin_lock(&sbi->lookup_lock); 639 639 __autofs_add_expiring(dentry); ··· 749 749 p_ino = autofs_dentry_ino(dentry->d_parent); 750 750 p_ino->count++; 751 751 inc_nlink(dir); 752 - dir->i_mtime = current_time(dir); 752 + dir->i_mtime = dir->i_ctime = current_time(dir); 753 753 754 754 return 0; 755 755 }