From 9f3629b018f9d25b205f911464789ed0a14103b4 Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Mon, 7 Jul 2008 17:53:48 +0000 Subject: [PATCH] linux-revalidate-renames-correctly-20080707 LICENSE IPL10 FIXES 74672 when renaming causes a dentry to be newer than its parent we handled it incorrectly. zero the d_time to force correct evaluation to happen. --- src/afs/LINUX/osi_vnodeops.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 94b386c23..539ca228d 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1307,13 +1307,7 @@ afs_linux_rename(struct inode *oldip, struct dentry *olddp, #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; @@ -1334,6 +1328,9 @@ afs_linux_rename(struct inode *oldip, struct dentry *olddp, 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); -- 2.39.5