From 0de4895aac4ef86dcde43ec8c992b8abd1a3fcbf Mon Sep 17 00:00:00 2001 From: Fedor Uporov Date: Thu, 26 Jan 2023 13:23:22 +0300 Subject: [PATCH] Fix pjfstest issue tests/rename/23.t This test creates two files like file0 and file1, then creates link to file1 and checks ctime on it. Then renames file0 to file1. Then checks ctime on link again. It is expected, that second ctime will be higher then first ctime, because rename happen. Add ctime updating for directory entry, which will be deleted on rename. Reviewed by: kib MFC after: 2 week Differential revision: https://reviews.freebsd.org/D38051 --- sys/fs/tmpfs/tmpfs_vnops.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index da934338948b..6a58ffdc0f4b 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1233,6 +1233,10 @@ tmpfs_rename(struct vop_rename_args *v) tde = tmpfs_dir_lookup(tdnode, tnode, tcnp); tmpfs_dir_detach(tdvp, tde); + /* Update node's ctime because of possible hardlinks. */ + tnode->tn_status |= TMPFS_NODE_CHANGED; + tmpfs_update(tvp); + /* * Free the directory entry we just deleted. Note that the * node referred by it will not be removed until the vnode is