]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-linux-revalidate-renames-correctly-20080707
authorChas Williams <chas@cmf.nrl.navy.mil>
Mon, 7 Jul 2008 17:53:59 +0000 (17:53 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 7 Jul 2008 17:53:59 +0000 (17:53 +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 ef57f2ef2683dc0a34c43c770761f8fb4a386c9f..5b1afc4cecad8310fcf87a53d6b70cbff9e7faf8 100644 (file)
@@ -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);