afs: Do not avoid DNLC if fakestat is set
authorAndrew Deason <adeason@sinenomine.net>
Fri, 18 May 2012 21:55:09 +0000 (17:55 -0400)
committerDerrick Brashear <shadow@your-file-system.com>
Thu, 6 Sep 2012 11:42:51 +0000 (04:42 -0700)
Currently in afs_lookup we avoid putting an entry in the DNLC if
'force_eval' is unset, in order to avoid populating the DNLC with
mountpoint symlinks (we want the target of the mountpoint to be in
there instead, the root dir). However, if -fakestat or -fakestat-all
are enabled, 'force_eval' is always false, since we only set it to
true under certain circumstances when evaluating mountpoints.

To fix this, populate the dnlc for non-mountpoints, even if force_eval
is unset.

Change-Id: Ia2fef1bea9a08182715d587517f81074147aa4e7
Reviewed-on: http://gerrit.openafs.org/7431
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/afs/VNOPS/afs_vnop_lookup.c

index 5bddf76..1a36056 100644 (file)
@@ -1928,7 +1928,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