windows-more-races-20050531
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 31 May 2005 18:36:28 +0000 (18:36 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 31 May 2005 18:36:28 +0000 (18:36 +0000)
a couple of more locations at which cm_SyncOpDone() either was not
called or was called without holding the scache mutex.

src/WINNT/afsd/cm_dcache.c
src/WINNT/afsd/cm_vnodeops.c

index d5d7c70..cd7d1c0 100644 (file)
@@ -670,6 +670,7 @@ long cm_SetupStoreBIOD(cm_scache_t *scp, osi_hyper_t *inOffsetp, long inSize,
                 osi_assertx(!(bufp->flags & CM_BUF_WRITING),
                             "WRITING w/o CMSTORING in SetupStoreBIOD");
                 bufp->flags |= CM_BUF_WRITING;
+                cm_SyncOpDone(scp, bufp, flags);
                 break;
             }
 
index 2cfcf8c..555023a 100644 (file)
@@ -2599,8 +2599,10 @@ long cm_Rename(cm_scache_t *oldDscp, char *oldNamep, cm_scache_t *newDscp,
                 lock_ReleaseMutex(&newDscp->mx);
                 if (code) {
                     /* cleanup first one */
+                    lock_ObtainMutex(&newDscp->mx);
                     cm_SyncOpDone(oldDscp, NULL,
                                    CM_SCACHESYNC_STOREDATA);
+                    lock_ReleaseMutex(&oldDscp->mx);
                 }       
             }
         }
@@ -2619,8 +2621,10 @@ long cm_Rename(cm_scache_t *oldDscp, char *oldNamep, cm_scache_t *newDscp,
                 lock_ReleaseMutex(&oldDscp->mx);
                 if (code) {
                     /* cleanup first one */
+                    lock_ObtainMutex(&newDscp->mx);
                     cm_SyncOpDone(newDscp, NULL,
                                    CM_SCACHESYNC_STOREDATA);
+                    lock_ReleaseMutex(&newDscp->mx);
                 }       
             }
         }