source: trunk/server/common/patches/openafs-revert-d_drop-new-file.patch @ 2633

Last change on this file since 2633 was 2633, checked in by andersk, 10 years ago
openafs: we beseech thee, raineth not thine ENOENT upon thy callers of getcwd() This reverts http://gerrit.openafs.org/11358 and adds some logging. Amen.
File size: 1.8 KB
  • src/afs/LINUX/osi_vnodeops.c

    From 097b5d31bcc325c7e33b1dcdf586c7b77bd00cbe Mon Sep 17 00:00:00 2001
    From: Anders Kaseorg <andersk@mit.edu>
    Date: Sun, 12 Oct 2014 22:21:40 -0400
    Subject: [PATCH] Revert "LINUX: Drop dentry if lookup returns new file" and
     log differences
    
    This reverts commit 81f1814b566cb3b1cda97be4c48b9788cd7addd0, and adds
    a warning message whenever it would have taken effect on a directory.
    
    Change-Id: I60e3a5feb49329b07c07b09edeb4b3c416faaac1
    ---
     src/afs/LINUX/osi_vnodeops.c | 22 +++++++++++++++-------
     1 file changed, 15 insertions(+), 7 deletions(-)
    
    diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
    index 2a8253e..6f0bbfb 100644
    a b afs_linux_dentry_revalidate(struct dentry *dp, int flags) 
    12451245            code = afs_lookup(pvcp, (char *)dp->d_name.name, &tvc, credp);
    12461246            if (!tvc || tvc != vcp) {
    12471247                dput(parent);
    1248                 /* Force unhash; the name doesn't point to this file
    1249                  * anymore. */
    1250                 force_drop = 1;
    1251                 if (code && code != ENOENT) {
    1252                     /* ...except if we couldn't perform the actual lookup,
    1253                      * we don't know if the name points to this file or not. */
    1254                     force_drop = 0;
     1248                /* Force unhash if name is known not to exist. */
     1249                if (code == ENOENT)
     1250                    force_drop = 1;
     1251
     1252                if (code == 0) {
     1253                    /* As of http://gerrit.openafs.org/11358, upstream
     1254                     * also sets force_drop = 1 in the code == 0 case,
     1255                     * but that seems to exacerbate the getcwd()
     1256                     * ENOENT problem. */
     1257                    if (dp->d_inode && S_ISDIR(dp->d_inode->i_mode)) {
     1258                        char buf[256];
     1259                        char *path = dentry_path_raw(dp, buf, sizeof(buf));
     1260                        pr_warn("openafs: Rescued directory /afs/%s from force_drop\n", IS_ERR(path) ? "(error)" : path);
     1261                    }
    12551262                }
     1263
    12561264                goto bad_dentry;
    12571265            }
    12581266
Note: See TracBrowser for help on using the repository browser.