From: Chas Williams Date: Mon, 7 Jul 2008 17:54:28 +0000 (+0000) Subject: STABLE14-linux-revalidate-renames-correctly-20080707 X-Git-Tag: openafs-stable-1_4_8pre1~50 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=32110a0ceada870f34d33ba40899707b76b0f603;p=packages%2Fo%2Fopenafs.git STABLE14-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. (cherry picked from commit 9f3629b018f9d25b205f911464789ed0a14103b4) --- diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index debfc931a..25b2703c9 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1271,13 +1271,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; @@ -1298,6 +1292,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);