diff options
author | Fedor Uporov <fsu@FreeBSD.org> | 2023-01-26 10:23:22 +0000 |
---|---|---|
committer | Fedor Uporov <fsu@FreeBSD.org> | 2023-01-29 08:12:32 +0000 |
commit | 0de4895aac4ef86dcde43ec8c992b8abd1a3fcbf (patch) | |
tree | 0b4a6c5027df7389a9a008e436194ac133aa23f3 | |
parent | 9ad2d4c4907da9c9edd4826219f6fa08544d31c4 (diff) | |
download | src-0de4895aac4ef86dcde43ec8c992b8abd1a3fcbf.tar.gz src-0de4895aac4ef86dcde43ec8c992b8abd1a3fcbf.zip |
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
-rw-r--r-- | sys/fs/tmpfs/tmpfs_vnops.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 |