VirtualBox

Changeset 78585 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 19, 2019 12:35:21 AM (6 years ago)
Author:
vboxsync
Message:

winnt/vboxsf: Do locking around the CcCoherencyFlushAndPurgeCache calls similar to what RDBSS does in the common read/write functions when calling CcFlushCache. bugref:9172

Location:
trunk/src/VBox/Additions/WINNT/SharedFolders/driver
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/file.cpp

    r78584 r78585  
    128128                LARGE_INTEGER offFlush;
    129129                offFlush.QuadPart = offFile;
     130                Assert(!RxContext->FcbPagingIoResourceAcquired);
     131                BOOLEAN AcquiredFile = RxAcquirePagingIoResourceShared(NULL, capFcb, 1 /*fWait*/);
    130132                g_pfnCcCoherencyFlushAndPurgeCache(&RxContext->NonPagedFcb->SectionObjectPointers, &offFlush, cbChunk,
    131133                                                   &RxContext->CurrentIrp->IoStatus, CC_FLUSH_AND_PURGE_NO_PURGE);
     134                if (AcquiredFile)
     135                {   RxReleasePagingIoResource(NULL, capFcb); /* requires {} */ }
    132136            }
    133137
     
    383387                && RxContext->NonPagedFcb->SectionObjectPointers.DataSectionObject != NULL)
    384388            {
    385                 /** @todo locking.   */
    386389                LARGE_INTEGER offFlush;
    387390                offFlush.QuadPart = offFile;
     391                BOOLEAN fAcquiredLock = RxAcquirePagingIoResource(NULL, capFcb);
    388392                g_pfnCcCoherencyFlushAndPurgeCache(&RxContext->NonPagedFcb->SectionObjectPointers, &offFlush, cbChunk,
    389393                                                   &RxContext->CurrentIrp->IoStatus, 0 /*fFlags*/);
     394                if (fAcquiredLock)
     395                {   RxReleasePagingIoResource(NULL, capFcb); /* requires {} */ }
    390396            }
    391397
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/info.cpp

    r78569 r78585  
    11621162     *       macros in need of {} wrappers when used with if statements.
    11631163     */
    1164     NTSTATUS rcNtLock = RxAcquirePagingIoResource(NULL, pFcb);
     1164    BOOLEAN fAcquiredLock = RxAcquirePagingIoResource(NULL, pFcb);
    11651165
    11661166    LONGLONG cbFileOldRecheck;
     
    12111211
    12121212                /* RDBSS leave the lock before calling CcSetFileSizes, so we do that too then.*/
    1213                 if (NT_SUCCESS(rcNtLock))
    1214                 {
    1215                     RxReleasePagingIoResource(NULL, pFcb);
    1216                 }
     1213                if (fAcquiredLock)
     1214                {   RxReleasePagingIoResource(NULL, pFcb); /* requires {} */ }
    12171215
    12181216                __try
     
    12421240             cbFileOld, cbFileNew, cbFileOldRecheck));
    12431241
    1244     if (NT_SUCCESS(rcNtLock))
    1245     {
    1246         RxReleasePagingIoResource(NULL, pFcb); /* requires {} */
    1247     }
     1242    if (fAcquiredLock)
     1243    {   RxReleasePagingIoResource(NULL, pFcb); /* requires {} */ }
    12481244}
    12491245
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette