Changeset 2634


Ignore:
Timestamp:
Oct 16, 2014, 3:37:45 AM (10 years ago)
Author:
andersk
Message:
openafs: Update force_drop patch to log more information requested by upstream
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/common/patches/openafs-revert-d_drop-new-file.patch

    r2633 r2634  
    1 From 097b5d31bcc325c7e33b1dcdf586c7b77bd00cbe Mon Sep 17 00:00:00 2001
     1From 88f51eecfc5a5edb92b252b202c24e54298fe129 Mon Sep 17 00:00:00 2001
    22From: Anders Kaseorg <andersk@mit.edu>
    33Date: Sun, 12 Oct 2014 22:21:40 -0400
     
    55 log differences
    66
    7 This reverts commit 81f1814b566cb3b1cda97be4c48b9788cd7addd0, and adds
    8 a warning message whenever it would have taken effect on a directory.
     7This effectively reverts commit
     881f1814b566cb3b1cda97be4c48b9788cd7addd0, and adds a warning message
     9whenever it would have taken effect.
    910
    10 Change-Id: I60e3a5feb49329b07c07b09edeb4b3c416faaac1
     11Change-Id: If470195b1eeb23d33693ade8d6fc79e903663529
    1112---
    12  src/afs/LINUX/osi_vnodeops.c | 22 +++++++++++++++-------
    13  1 file changed, 15 insertions(+), 7 deletions(-)
     13 src/afs/LINUX/osi_vnodeops.c | 18 ++++++++++++++++++
     14 1 file changed, 18 insertions(+)
    1415
    1516diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
    16 index 2a8253e..6f0bbfb 100644
     17index 2a8253e..e22f62a 100644
    1718--- a/src/afs/LINUX/osi_vnodeops.c
    1819+++ b/src/afs/LINUX/osi_vnodeops.c
    19 @@ -1245,14 +1245,22 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags)
    20             code = afs_lookup(pvcp, (char *)dp->d_name.name, &tvc, credp);
    21             if (!tvc || tvc != vcp) {
    22                 dput(parent);
    23 -               /* Force unhash; the name doesn't point to this file
    24 -                * anymore. */
    25 -               force_drop = 1;
    26 -               if (code && code != ENOENT) {
    27 -                   /* ...except if we couldn't perform the actual lookup,
    28 -                    * we don't know if the name points to this file or not. */
    29 -                   force_drop = 0;
    30 +               /* Force unhash if name is known not to exist. */
    31 +               if (code == ENOENT)
    32 +                   force_drop = 1;
    33 +
    34 +               if (code == 0) {
    35 +                   /* As of http://gerrit.openafs.org/11358, upstream
    36 +                    * also sets force_drop = 1 in the code == 0 case,
    37 +                    * but that seems to exacerbate the getcwd()
    38 +                    * ENOENT problem. */
    39 +                   if (dp->d_inode && S_ISDIR(dp->d_inode->i_mode)) {
    40 +                       char buf[256];
    41 +                       char *path = dentry_path_raw(dp, buf, sizeof(buf));
    42 +                       pr_warn("openafs: Rescued directory /afs/%s from force_drop\n", IS_ERR(path) ? "(error)" : path);
    43 +                   }
     20@@ -1253,6 +1253,24 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags)
     21                     * we don't know if the name points to this file or not. */
     22                    force_drop = 0;
    4423                }
    45 +
     24+               if (force_drop && tvc && tvc != vcp &&
     25+                   !(dp->d_inode && S_ISREG(dp->d_inode->i_mode))) {
     26+                   /* workaround and logging for GCO RT 131780 */
     27+                   char buf[256];
     28+                   char *path = dentry_path_raw(dp, buf, sizeof(buf));
     29+                   afs_warn("afs: RT 131780: got back a different vcache for /afs%s: "
     30+                            "vcp: %u.%u.%u mvstat %d, tvc: %u.%u.%u mvstat %d\n",
     31+                            IS_ERR(path) ? "/(bad path)" : path,
     32+                            (unsigned)vcp->f.fid.Fid.Volume,
     33+                            (unsigned)vcp->f.fid.Fid.Vnode,
     34+                            (unsigned)vcp->f.fid.Fid.Unique,
     35+                            (int)vcp->mvstat,
     36+                            (unsigned)tvc->f.fid.Fid.Volume,
     37+                            (unsigned)tvc->f.fid.Fid.Vnode,
     38+                            (unsigned)tvc->f.fid.Fid.Unique,
     39+                            (int)tvc->mvstat);
     40+                   force_drop = 0;
     41+               }
    4642                goto bad_dentry;
    4743            }
Note: See TracChangeset for help on using the changeset viewer.