From: Jeffrey Altman Date: Sun, 22 Jan 2012 23:33:43 +0000 (-0500) Subject: Windows; release BIOD after status merge X-Git-Tag: upstream/1.6.1.pre4^2~17 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=0a42fc8d9a57601cd1a7d1e5ac2abc7d544c0dda;p=packages%2Fo%2Fopenafs.git Windows; release BIOD after status merge Releasing the BIOD permits the accumulated buffers to be accessed. Releasing the BIOD before the cm_MergeStatus() call creates a window where the buffer data version is larger than the cm_scache data version. Release the BIOD after the status merge. Reviewed-on: http://gerrit.openafs.org/6598 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman (cherry picked from commit 111de76ea8dac713247c99ebe2182ae16cc0a3c0) Change-Id: I7c8dd9f3e22e83b82679b9d3a4ee3aa5f45a49aa Reviewed-on: http://gerrit.openafs.org/6824 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsd/cm_dcache.c b/src/WINNT/afsd/cm_dcache.c index 855c68d01..78212d050 100644 --- a/src/WINNT/afsd/cm_dcache.c +++ b/src/WINNT/afsd/cm_dcache.c @@ -347,8 +347,6 @@ long cm_BufWrite(void *vscp, osi_hyper_t *offsetp, long length, long flags, /* now, clean up our state */ lock_ObtainWrite(&scp->rw); - cm_ReleaseBIOD(&biod, 1, code, 1); - if (code == 0) { osi_hyper_t t; /* now, here's something a little tricky: in AFS 3, a dirty @@ -388,6 +386,8 @@ long cm_BufWrite(void *vscp, osi_hyper_t *offsetp, long length, long flags, else if (code == CM_ERROR_QUOTA) _InterlockedOr(&scp->flags, CM_SCACHEFLAG_OVERQUOTA); } + + cm_ReleaseBIOD(&biod, 1, code, 1); cm_SyncOpDone(scp, NULL, CM_SCACHESYNC_STOREDATA_EXCL); if (!scp_locked) @@ -2098,14 +2098,14 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *userp } } - /* release scatter/gather I/O structure (buffers, locks) */ - cm_ReleaseBIOD(&biod, 0, code, 1); - if (code == 0) cm_MergeStatus(NULL, scp, &afsStatus, &volSync, userp, reqp, CM_MERGEFLAG_FETCHDATA); else InterlockedDecrement(&scp->activeRPCs); + /* release scatter/gather I/O structure (buffers, locks) */ + cm_ReleaseBIOD(&biod, 0, code, 1); + return code; }