]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-linux-revalidate-renames-correctly-20080707
authorChas Williams <chas@cmf.nrl.navy.mil>
Mon, 7 Jul 2008 17:54:28 +0000 (17:54 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 7 Jul 2008 17:54:28 +0000 (17:54 +0000)
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)

src/afs/LINUX/osi_vnodeops.c

index debfc931a0dcb49c469145cdafbfe703a2eb5dcf..25b2703c91bcef1cf06299d727710f141fc2ce09 100644 (file)
@@ -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);