From c5e362a683c5a0b2e046aa62d652ff1c83e42818 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 19 Nov 2009 18:21:39 -0500 Subject: [PATCH] Windows: cm_TryBulkStatus processing changes move the logging of success or failure in order to try to avoid the VS8 compiler optimizing them out. merge the bulk status information if the current cm_scache_t object is flagged with an access denied failure on the last request or if it is a readonly volume. This permits us to return something valid to the directory enumeration that generated the cm_TryBulkStatus call. LICENSE MIT Change-Id: I97e9e096e2c36b0a87baaa8d728b588aaf10f153 Reviewed-on: http://gerrit.openafs.org/858 Reviewed-by: Derrick Brashear Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman --- src/WINNT/afsd/cm_vnodeops.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/WINNT/afsd/cm_vnodeops.c b/src/WINNT/afsd/cm_vnodeops.c index 4a13e40f0..e40332355 100644 --- a/src/WINNT/afsd/cm_vnodeops.c +++ b/src/WINNT/afsd/cm_vnodeops.c @@ -2342,18 +2342,17 @@ cm_TryBulkStatRPC(cm_scache_t *dscp, cm_bulkStat_t *bbp, cm_user_t *userp, cm_re } while (cm_Analyze(connp, userp, reqp, &dscp->fid, &volSync, NULL, &cbReq, code)); code = cm_MapRPCError(code, reqp); - if (code) - osi_Log2(afsd_logp, "CALL %sBulkStatus FAILURE code 0x%x", - inlinebulk ? "Inline" : "", code); - else - osi_Log1(afsd_logp, "CALL %sBulkStatus SUCCESS", inlinebulk ? "Inline" : ""); /* may as well quit on an error, since we're not going to do * much better on the next immediate call, either. */ if (code) { + osi_Log2(afsd_logp, "CALL %sBulkStatus FAILURE code 0x%x", + inlinebulk ? "Inline" : "", code); cm_EndCallbackGrantingCall(NULL, &cbReq, NULL, NULL, 0); break; + } else { + osi_Log1(afsd_logp, "CALL %sBulkStatus SUCCESS", inlinebulk ? "Inline" : ""); } /* otherwise, we should do the merges */ @@ -2377,12 +2376,16 @@ cm_TryBulkStatRPC(cm_scache_t *dscp, cm_bulkStat_t *bbp, cm_user_t *userp, cm_re * * Right now, be pretty conservative: if there's a * callback or a pending call, skip it. + * However, if the prior attempt to obtain status + * was refused access or the volume is .readonly, + * take the data in any case since we have nothing + * better for the in flight directory enumeration that + * resulted in this function being called. */ - if ((scp->cbServerp == NULL || (scp->flags & CM_SCACHEFLAG_EACCESS)) - && !(scp->flags & - (CM_SCACHEFLAG_FETCHING - | CM_SCACHEFLAG_STORING - | CM_SCACHEFLAG_SIZESTORING))) { + if ((scp->cbServerp == NULL && + !(scp->flags & (CM_SCACHEFLAG_FETCHING | CM_SCACHEFLAG_STORING | CM_SCACHEFLAG_SIZESTORING))) || + (scp->flags & CM_SCACHEFLAG_PURERO) || + (scp->flags & CM_SCACHEFLAG_EACCESS)) { cm_EndCallbackGrantingCall(scp, &cbReq, &bbp->callbacks[j], &volSync, -- 2.39.5