#if defined(AFS_LINUX26_ENV)
/* Prevent any new references during rename operation. */
lock_kernel();
-#endif
- /* Remove old and new entries from name hash. New one will change below.
- * While it's optimal to catch failures and re-insert newdp into hash,
- * it's also error prone and in that case we're already dealing with error
- * cases. Let another lookup put things right, if need be.
- */
-#if defined(AFS_LINUX26_ENV)
+
if (!d_unhashed(newdp)) {
d_drop(newdp);
rehash = newdp;
code = afs_rename(VTOAFS(oldip), oldname, VTOAFS(newip), newname, credp);
AFS_GUNLOCK();
+ if (!code)
+ olddp->d_time = 0; /* force to revalidate */
+
if (rehash)
d_rehash(rehash);