Fix vcache/vnode mismatch in lookup for DARWIN
[openafs.git] / src / afs / VNOPS / afs_vnop_lookup.c
index 2a5d594..ee95ac5 100644 (file)
@@ -861,7 +861,7 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
                    else
                        tvcp->f.m.Type = VREG;
                    /* finalize to a best guess */
-                   afs_darwin_finalizevnode(tvcp, VTOAFS(adp), NULL, 0, 1);
+                   afs_darwin_finalizevnode(tvcp, AFSTOV(adp), NULL, 0, 1);
                    /* re-acquire usecount that finalizevnode disposed of */
                    vnode_ref(AFSTOV(tvcp));
 #endif
@@ -1342,7 +1342,7 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
 
 /* was: (AFS_DEC_ENV) || defined(AFS_OSF30_ENV) || defined(AFS_NCR_ENV) */
 #ifdef AFS_DARWIN80_ENV
-int AFSDOBULK = 1;
+int AFSDOBULK = 0;
 #else
 static int AFSDOBULK = 1;
 #endif
@@ -1381,7 +1381,6 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr
     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;
     int no_read_access = 0;
     struct sysname_info sysState;      /* used only for @sys checking */
@@ -1431,11 +1430,8 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr
     if (code)
        goto done;
 
-    *avcp = NULL;              /* Since some callers don't initialize it */
-
     /* come back to here if we encounter a non-existent object in a read-only
      * volume's directory */
-
   redo:
     *avcp = NULL;              /* Since some callers don't initialize it */
     bulkcode = 0;
@@ -1928,7 +1924,7 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr
             * volume) 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 */
-           if (!hit && force_eval) {
+           if (!hit && (force_eval || tvc->mvstat != 1)) {
                osi_dnlc_enter(adp, aname, tvc, &versionNo);
            } else {
 #ifdef AFS_LINUX20_ENV