From: Russ Allbery Date: Thu, 22 Dec 2005 02:54:56 +0000 (+0000) Subject: * Apply upstream patch from Chas Williams to be more careful about what X-Git-Tag: debian/1.4.0-3~5 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=45fada1339bfd22934d6978b7f8894862304804b;p=packages%2Fo%2Fopenafs.git * Apply upstream patch from Chas Williams to be more careful about what dentry is used in renames, avoiding a kernel fault when renaming dentries accessed through multiple paths (such as RO and RW). --- diff --git a/debian/changelog b/debian/changelog index d0dba479d..dc910b301 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,8 @@ openafs (1.4.0-3) unstable; urgency=low + * Apply upstream patch from Chas Williams to be more careful about what + dentry is used in renames, avoiding a kernel fault when renaming + dentries accessed through multiple paths (such as RO and RW). * Apply patch to allow the module to build with the Ubuntu kernel. Thanks, Björn Torkelsson. (Closes: #342607) * Stop unconditionally forcing the compiler to cc or gcc in configure, @@ -20,7 +23,7 @@ openafs (1.4.0-3) unstable; urgency=low goes into each package. * Don't ignore make distclean errors. - -- Russ Allbery Wed, 21 Dec 2005 15:43:47 -0800 + -- Russ Allbery Wed, 21 Dec 2005 18:54:12 -0800 openafs (1.4.0-2) unstable; urgency=low diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 64c0ed662..19a1c0139 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -884,11 +884,9 @@ static int afs_linux_lookup(struct inode *dip, struct dentry *dp) #endif { - struct vattr vattr; cred_t *credp = crref(); struct vcache *vcp = NULL; const char *comp = dp->d_name.name; - struct dentry *res = NULL; struct inode *ip = NULL; int code; @@ -899,24 +897,33 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp) code = afs_lookup(VTOAFS(dip), comp, &vcp, credp); if (vcp) { - ip = AFSTOV(vcp); + struct vattr vattr; + ip = AFSTOV(vcp); afs_getattr(vcp, &vattr, credp); afs_fill_inode(ip, &vattr); } dp->d_op = &afs_dentry_operations; dp->d_time = hgetlo(VTOAFS(dip)->m.DataVersion); AFS_GUNLOCK(); + #if defined(AFS_LINUX24_ENV) if (ip && S_ISDIR(ip->i_mode)) { - d_prune_aliases(ip); - res = d_find_alias(ip); + struct dentry *alias; + + alias = d_find_alias(ip); + if (alias) { + if (d_invalidate(alias) == 0) { + dput(alias); + } else { + iput(ip); +#if defined(AFS_LINUX26_ENV) + unlock_kernel(); +#endif + return alias; + } + } } - if (res) { - if (d_unhashed(res)) - d_rehash(res); - iput(ip); - } else #endif d_add(dp, ip); @@ -928,10 +935,6 @@ 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);