diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 46906da7e6..2baa77f625 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1333,6 +1333,8 @@ afs_linux_rename(struct inode *oldip, struct dentry *olddp, const char *newname = newdp->d_name.name; #if defined(AFS_LINUX26_ENV) + struct dentry *rehash = NULL; + lock_kernel(); #endif /* Remove old and new entries from name hash. New one will change below. @@ -1341,10 +1343,17 @@ afs_linux_rename(struct inode *oldip, struct dentry *olddp, * cases. Let another lookup put things right, if need be. */ #if defined(AFS_LINUX26_ENV) - if (!d_unhashed(olddp)) - d_drop(olddp); - if (!d_unhashed(newdp)) + if (!d_unhashed(newdp)) { d_drop(newdp); + rehash = newdp; + } + +#ifdef maybe + if (atomic_read(&olddp->d_count) > 1) { + printk("afs_linux_rename::shrink_dcache_parent()\n"); + shrink_dcache_parent(olddp); + } +#endif #else if (!list_empty(&olddp->d_hash)) d_drop(olddp); @@ -1355,13 +1364,11 @@ afs_linux_rename(struct inode *oldip, struct dentry *olddp, code = afs_rename(ITOAFS(oldip), oldname, ITOAFS(newip), newname, credp); AFS_GUNLOCK(); - if (!code) { - /* update time so it doesn't expire immediately */ - newdp->d_time = jiffies; - d_move(olddp, newdp); - } #if defined(AFS_LINUX26_ENV) + if (rehash) + d_rehash(rehash); + unlock_kernel(); #endif