]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-linux-vnode-aliases-20050529
authorChaskiel M Grundman <cg2v@andrew.cmu.edu>
Mon, 30 May 2005 05:33:57 +0000 (05:33 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 30 May 2005 05:33:57 +0000 (05:33 +0000)
FIXES 18613

you can end up hanging when you end up with multiple aliases for a single directory (dentry) as a result of @sys or multiple mountpoints.

don't end up with multiple aliases, and avoid the situation

(cherry picked from commit 2995362346abd9691bc8d4ceca57247e1954fb1d)

src/afs/LINUX/osi_vnodeops.c

index 943137f3c6375c553b86e4bfdeb1867a67543edb..f237d61a384c60af9832bc5a2e7b99fe16914a8b 100644 (file)
@@ -1054,6 +1054,9 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
     cred_t *credp = crref();
     struct vcache *vcp = NULL;
     const char *comp = dp->d_name.name;
+#if 1
+    struct dentry *res = 0;
+#endif
 
 #if defined(AFS_LINUX26_ENV)
     lock_kernel();
@@ -1073,6 +1076,8 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
        } else if (S_ISDIR(ip->i_mode)) {
            ip->i_op = &afs_dir_iops;
            ip->i_fop = &afs_dir_fops;
+            d_prune_aliases(ip);
+            res = d_find_alias(ip);
        } else if (S_ISLNK(ip->i_mode)) {
            ip->i_op = &afs_symlink_iops;
            ip->i_data.a_ops = &afs_symlink_aops;
@@ -1096,6 +1101,12 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
     }
     dp->d_op = &afs_dentry_operations;
     dp->d_time = hgetlo(ITOAFS(dip)->m.DataVersion);
+#if defined(AFS_LINUX24_ENV)
+    if (res) {
+       if (d_unhashed(res))
+           d_rehash(res);
+    } else
+#endif
     d_add(dp, AFSTOI(vcp));
 
 #if defined(AFS_LINUX26_ENV)
@@ -1106,6 +1117,10 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
     /* It's ok for the file to not be found. That's noted by the caller by
      * seeing that the dp->d_inode field is NULL.
      */
+#if defined(AFS_LINUX24_ENV)
+    if (code == 0)
+        return res;
+#endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10)
     if (code == ENOENT)
        return ERR_PTR(0);