From: Chaskiel M Grundman Date: Mon, 30 May 2005 05:33:57 +0000 (+0000) Subject: STABLE14-linux-vnode-aliases-20050529 X-Git-Tag: openafs-devel-1_3_83~15 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=86576b4e0b3d631b06c0a12db751d9e397c9de85;p=packages%2Fo%2Fopenafs.git STABLE14-linux-vnode-aliases-20050529 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) --- diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 943137f3c..f237d61a3 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -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);