From a60594ef54c1458f6778d0b16d870803e1594d41 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 2 Dec 2011 13:36:01 -0500 Subject: [PATCH] Windows: cm_MergeStatus redirector invalidation The redirector maintains its own cached status information which must be updated when a DV change occurs that is not the result of a redirector initiated data change. If the current old DV is BAD, send a DV change notification. If the DV has changed and request was not initiated by the redirector, send a DV change notification. If the request was initiated by the redirector, send a notification for store and directory operations that result in a DV change greater than the number of active RPCs or any other operation that results in an unexpected DV change such as FetchStatus. Change-Id: I6dd4c9d450901e4b5d4c8d67841e3b833cebbe1f Reviewed-on: http://gerrit.openafs.org/6177 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsd/cm_scache.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/WINNT/afsd/cm_scache.c b/src/WINNT/afsd/cm_scache.c index 1a8def90d..ffbb06d37 100644 --- a/src/WINNT/afsd/cm_scache.c +++ b/src/WINNT/afsd/cm_scache.c @@ -1807,14 +1807,34 @@ void cm_MergeStatus(cm_scache_t *dscp, scp->bufDataVersionLow = dataVersion; if (RDR_Initialized) { - if (scp->dataVersion != CM_SCACHE_VERSION_BAD) { - rdr_invalidate = 1; - } else if ( ( !(reqp->flags & CM_REQ_SOURCE_REDIR) || !(flags & (CM_MERGEFLAG_DIROP|CM_MERGEFLAG_STOREDATA))) && - scp->dataVersion != dataVersion && (dataVersion - scp->dataVersion > activeRPCs - 1)) { + /* + * The redirector maintains its own cached status information which + * must be updated when a DV change occurs that is not the result + * of a redirector initiated data change. + * + * If the current old DV is BAD, send a DV change notification. + * + * If the DV has changed and request was not initiated by the + * redirector, send a DV change notification. + * + * If the request was initiated by the redirector, send a notification + * for store and directory operations that result in a DV change greater + * than the number of active RPCs or any other operation that results + * in an unexpected DV change such as FetchStatus. + */ + + if (scp->dataVersion == CM_SCACHE_VERSION_BAD) { rdr_invalidate = 1; - } else if ( (reqp->flags & CM_REQ_SOURCE_REDIR) && (flags & (CM_MERGEFLAG_DIROP|CM_MERGEFLAG_STOREDATA)) && - dataVersion - scp->dataVersion > activeRPCs) { + } else if (!(reqp->flags & CM_REQ_SOURCE_REDIR) && scp->dataVersion != dataVersion) { rdr_invalidate = 1; + } else if (reqp->flags & CM_REQ_SOURCE_REDIR) { + if (!(flags & (CM_MERGEFLAG_DIROP|CM_MERGEFLAG_STOREDATA)) && + (dataVersion - scp->dataVersion > activeRPCs - 1)) { + rdr_invalidate = 1; + } else if ((flags & (CM_MERGEFLAG_DIROP|CM_MERGEFLAG_STOREDATA)) && + dataVersion - scp->dataVersion > activeRPCs) { + rdr_invalidate = 1; + } } } scp->dataVersion = dataVersion; -- 2.39.5