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, 11 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
RevLine 
[2633]1From 097b5d31bcc325c7e33b1dcdf586c7b77bd00cbe Mon Sep 17 00:00:00 2001
2From: Anders Kaseorg <andersk@mit.edu>
3Date: Sun, 12 Oct 2014 22:21:40 -0400
4Subject: [PATCH] Revert "LINUX: Drop dentry if lookup returns new file" and
5 log differences
6
7This reverts commit 81f1814b566cb3b1cda97be4c48b9788cd7addd0, and adds
8a warning message whenever it would have taken effect on a directory.
9
10Change-Id: I60e3a5feb49329b07c07b09edeb4b3c416faaac1
11---
12 src/afs/LINUX/osi_vnodeops.c | 22 +++++++++++++++-------
13 1 file changed, 15 insertions(+), 7 deletions(-)
14
15diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
16index 2a8253e..6f0bbfb 100644
17--- a/src/afs/LINUX/osi_vnodeops.c
18+++ 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+                   }
44                }
45+
46                goto bad_dentry;
47            }
48 
49--
502.1.2
51
Note: See TracBrowser for help on using the repository browser.