From 6890c3a990cb4b09bb17e00225082dcdd33bd248 Mon Sep 17 00:00:00 2001 From: Peter Holm Date: Mon, 31 Oct 2011 15:01:47 +0000 Subject: [PATCH] The kern_renameat() looks up the fvp using the DELETE flag, which causes the removal of the name cache entry for fvp. Reported by: Anton Yuzhaninov In collaboration with: kib MFC after: 1 week --- sys/ufs/ufs/ufs_vnops.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 733413d319d..105bdafad4b 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1519,6 +1519,13 @@ relock: cache_purge(fdvp); } error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, 0); + /* + * As the relookup of the fvp is done in two steps: + * ufs_lookup_ino() and then VFS_VGET(), another thread might do a + * normal lookup of the from name just before the VFS_VGET() call, + * causing the cache entry to be re-instantiated. + */ + cache_purge(fvp); unlockout: vput(fdvp);