]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-linux-fakestat-avoid-mtpt-fillin-issue-20080415
authorRainer Toebbicke <rtb@pclella.cern.ch>
Tue, 15 Apr 2008 13:29:54 +0000 (13:29 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 15 Apr 2008 13:29:54 +0000 (13:29 +0000)
LICENSE IPL10
FIXES 93898

"It is actually the detection of a "cell" in the mount point string
which triggers the (loosely consistent) fakestat handling - it's
treated like a foreign cell and the mount point is never "completely
evaluated", i.e. logically replaced by the root directory of the
volume in question. As a result, callbacks are ignored, as they go
against the directory and not the mount point."

(cherry picked from commit 5f6b59f4601e9892e082a145a75e5872818d2e06)

src/afs/LINUX/osi_vnodeops.c
src/afs/VNOPS/afs_vnop_lookup.c

index ea0b13124c0ba79c9602092874421acbf67f85e9..265ce512b1ec3bfd4d9280646497b1b16419b85a 100644 (file)
@@ -803,8 +803,14 @@ afs_linux_dentry_revalidate(struct dentry *dp)
        if (vcp == afs_globalVp)
            goto good_dentry;
 
-       if (*dp->d_name.name != '/' && vcp->mvstat == 2)        /* root vnode */
-           check_bad_parent(dp);       /* check and correct mvid */
+       if (vcp->mvstat == 1) {         /* mount point */
+           if (vcp->mvid && (vcp->states & CMValid)) {
+               /* a mount point, not yet replaced by its directory */
+               goto bad_dentry;
+           }
+       } else
+           if (*dp->d_name.name != '/' && vcp->mvstat == 2) /* root vnode */
+               check_bad_parent(dp);   /* check and correct mvid */
 
 #ifdef notdef
        /* If the last looker changes, we should make sure the current
index e66ac6010a67aa02282653eb6911289a29554574..6ecf424f068bfd1e2b4a983c7dbde9a67de9abd7 100644 (file)
@@ -1120,6 +1120,7 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, struct AFS_UCRED
     register afs_int32 code;
     register afs_int32 bulkcode = 0;
     int pass = 0, hit = 0;
+    int force_eval = afs_fakestat_enable ? 0 : 1;
     long dirCookie;
     extern afs_int32 afs_mariner;      /*Writing activity to log? */
     afs_hyper_t versionNo;
@@ -1442,8 +1443,6 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, struct AFS_UCRED
     }                          /* sub-block just to reduce stack usage */
 
     if (tvc) {
-       int force_eval = afs_fakestat_enable ? 0 : 1;
-
        if (adp->states & CForeign)
            tvc->states |= CForeign;
        tvc->parentVnode = adp->fid.Fid.Vnode;
@@ -1464,6 +1463,9 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, struct AFS_UCRED
                force_eval = 1;
            ReleaseReadLock(&tvc->lock);
        }
+       if (tvc->mvstat == 1 && (tvc->states & CMValid) && tvc->mvid != NULL)
+         force_eval = 1; /* This is now almost for free, get it correct */
+
 #if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS)
        if (!(flags & AFS_LOOKUP_NOEVAL))
            /* don't eval mount points */
@@ -1589,7 +1591,7 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, struct AFS_UCRED
             * rather than the vc of the mount point itself.  we can still find the
             * mount point's vc in the vcache by its fid. */
 #endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
-           if (!hit) {
+           if (!hit && force_eval) {
                osi_dnlc_enter(adp, aname, tvc, &versionNo);
            } else {
 #ifdef AFS_LINUX20_ENV