]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
* Apply upstream patch from Chas Williams to be more careful about what
authorRuss Allbery <rra@debian.org>
Thu, 22 Dec 2005 02:54:56 +0000 (02:54 +0000)
committerRuss Allbery <rra@debian.org>
Thu, 22 Dec 2005 02:54:56 +0000 (02:54 +0000)
    dentry is used in renames, avoiding a kernel fault when renaming
    dentries accessed through multiple paths (such as RO and RW).

debian/changelog
src/afs/LINUX/osi_vnodeops.c

index d0dba479d0fc19457c999b7fc4289d7ed85bb474..dc910b301024ce82c50198d1dc4ce8e86bae9045 100644 (file)
@@ -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 <rra@debian.org>  Wed, 21 Dec 2005 15:43:47 -0800
+ -- Russ Allbery <rra@debian.org>  Wed, 21 Dec 2005 18:54:12 -0800
 
 openafs (1.4.0-2) unstable; urgency=low
 
index 64c0ed66256e31897621f457368ba8e94d752658..19a1c0139a2b776bd45beec48ac8aff4d7ad6d05 100644 (file)
@@ -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);