From: Jeffrey Altman Date: Tue, 27 Dec 2011 01:44:36 +0000 (-0500) Subject: Windows: RequestExtents avoid bufWrite if rdr held X-Git-Tag: openafs-stable-1_8_0pre1~2876 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=970d6e268011ab4ad8a4857121933514f7768b55 Windows: RequestExtents avoid bufWrite if rdr held If the cm_buf_t is held by the redirector the buffer cannot be written back to the file server even if dirty. Therefore, do not check whether or not the cm_buf_t is dirty until after it is known that the buffer is not redirector owned. Change-Id: I10dc8f74915c2267dc44138284eba273eb708e0a Reviewed-on: http://gerrit.openafs.org/6432 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsrdr/user/RDRFunction.c b/src/WINNT/afsrdr/user/RDRFunction.c index 709a611..48ebac3 100644 --- a/src/WINNT/afsrdr/user/RDRFunction.c +++ b/src/WINNT/afsrdr/user/RDRFunction.c @@ -2972,9 +2972,6 @@ RDR_BkgFetch(cm_scache_t *scp, afs_uint32 p1, afs_uint32 p2, afs_uint32 p3, afs_ code = cm_GetBuffer(scp, bufp, NULL, userp, reqp); if (code == 0) { - if (bufp->flags & CM_BUF_DIRTY) - cm_BufWrite(scp, &bufp->offset, cm_chunkSize, CM_BUF_WRITE_SCP_LOCKED, userp, reqp); - if (!(bufp->qFlags & CM_BUF_QREDIR)) { #ifdef VALIDATE_CHECK_SUM #ifdef ODS_DEBUG @@ -2982,6 +2979,9 @@ RDR_BkgFetch(cm_scache_t *scp, afs_uint32 p1, afs_uint32 p2, afs_uint32 p3, afs_ char dbgstr[1024]; #endif #endif + if (bufp->flags & CM_BUF_DIRTY) + cm_BufWrite(scp, &bufp->offset, cm_data.buf_blockSize, CM_BUF_WRITE_SCP_LOCKED, userp, reqp); + lock_ObtainWrite(&buf_globalLock); if (!(bufp->flags & CM_BUF_DIRTY) && bufp->cmFlags == 0 &&