source: server/common/patches/openafs-enoent.patch @ 848

Last change on this file since 848 was 848, checked in by andersk, 15 years ago
Unrevert STABLE14-linux-fakestat-avoid-mtpt-fillin-issue-20080415 and add /afs/andrew.cmu.edu/usr/shadow/scripts-enoent-2.diff to fix the ENOENT bug. [r846 was actually the ENOTDIR bug.]
File size: 1.8 KB
RevLine 
[848]1Index: osi_vnodeops.c
2===================================================================
3RCS file: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v
4retrieving revision 1.81.2.68
5diff -u -r1.81.2.68 osi_vnodeops.c
6--- src/afs/LINUX/osi_vnodeops.c        7 Oct 2008 03:41:15 -0000       1.81.2.68
7+++ src/afs/LINUX/osi_vnodeops.c        7 Oct 2008 16:51:47 -0000
8@@ -789,11 +789,13 @@
9     cred_t *credp = NULL;
10     struct vcache *vcp, *pvcp, *tvc = NULL;
11     int valid;
12+    struct afs_fakestat_state fakestate;
13 
14 #ifdef AFS_LINUX24_ENV
15     lock_kernel();
16 #endif
17     AFS_GLOCK();
18+    afs_InitFakeStat(&fakestate);
19 
20     if (dp->d_inode) {
21 
22@@ -805,8 +807,28 @@
23 
24        if (vcp->mvstat == 1) {         /* mount point */
25            if (vcp->mvid && (vcp->states & CMValid)) {
26-               /* a mount point, not yet replaced by its directory */
27-               goto bad_dentry;
28+               int tryEvalOnly = 0;
29+               int code = 0;
30+               struct vrequest treq;
31+
32+               credp = crref();
33+               code = afs_InitReq(&treq, credp);
34+               if (
35+#ifdef AFS_DARWIN_ENV
36+                   (strcmp(dp->d_name.name, ".DS_Store") == 0) ||
37+                   (strcmp(dp->d_name.name, "Contents") == 0) ||
38+#endif
39+                   (strcmp(dp->d_name.name, ".directory") == 0)) {
40+                   tryEvalOnly = 1;
41+               }
42+               if (tryEvalOnly)
43+                   code = afs_TryEvalFakeStat(&vcp, &fakestate, &treq);
44+               else
45+                   code = afs_EvalFakeStat(&vcp, &fakestate, &treq);
46+               if ((tryEvalOnly && vcp->mvstat == 1) || code) {
47+                   /* a mount point, not yet replaced by its directory */
48+                   goto bad_dentry;
49+               }
50            }
51        } else
52            if (*dp->d_name.name != '/' && vcp->mvstat == 2) /* root vnode */
53@@ -870,6 +892,7 @@
54     /* Clean up */
55     if (tvc)
56        afs_PutVCache(tvc);
57+    afs_PutFakeStat(&fakestate);
58     AFS_GUNLOCK();
59     if (credp)
60        crfree(credp);
61@@ -884,7 +907,10 @@
62     return valid;
63 
64   bad_dentry:
65-    valid = 0;
66+    if (have_submounts(dp))
67+       valid = 1;
68+    else
69+       valid = 0;
70     goto done;
71 }
72 
Note: See TracBrowser for help on using the repository browser.