VirtualBox

Changeset 37119 in vbox


Ignore:
Timestamp:
May 17, 2011 7:41:10 AM (14 years ago)
Author:
vboxsync
Message:

VD: Fix rare hangs during I/O with flat VMDK images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/VD.cpp

    r37100 r37119  
    27212721                 pIoStorage, pIoCtx, pfnComplete, pvUser, cbTransfer, rcReq));
    27222722
     2723    RTCritSectEnter(&pDisk->CritSect);
    27232724    Assert(pIoCtx->cbTransferLeft >= cbTransfer);
    27242725    ASMAtomicSubU32(&pIoCtx->cbTransferLeft, cbTransfer);
     
    27262727
    27272728    if (pfnComplete)
    2728     {
    2729         RTCritSectEnter(&pDisk->CritSect);
    27302729        rc = pfnComplete(pIoStorage->pVDIo->pBackendData, pIoCtx, pvUser, rcReq);
    2731         RTCritSectLeave(&pDisk->CritSect);
    2732     }
    27332730
    27342731    if (RT_SUCCESS(rc))
     
    27362733    else if (rc == VERR_VD_ASYNC_IO_IN_PROGRESS)
    27372734        rc = VINF_SUCCESS;
     2735
     2736    RTCritSectLeave(&pDisk->CritSect);
    27382737
    27392738    return rc;
     
    27772776    else
    27782777        RTListMove(&ListIoCtxWaiting, &pMetaXfer->ListIoCtxWaiting);
    2779     RTCritSectLeave(&pDisk->CritSect);
    27802778
    27812779    /* Go through the waiting list and continue the I/O contexts. */
     
    27922790
    27932791        if (pfnComplete)
    2794         {
    2795             RTCritSectEnter(&pDisk->CritSect);
    27962792            rc = pfnComplete(pIoStorage->pVDIo->pBackendData, pIoCtx, pvUser, rcReq);
    2797             RTCritSectLeave(&pDisk->CritSect);
    2798         }
    27992793
    28002794        LogFlow(("Completion callback for I/O context %#p returned %Rrc\n", pIoCtx, rc));
     
    28122806    if (RT_SUCCESS(rcReq) && !fFlush)
    28132807    {
    2814         RTCritSectEnter(&pDisk->CritSect);
    28152808        pMetaXfer->cRefs--;
    28162809        if (!pMetaXfer->cRefs && RTListIsEmpty(&pMetaXfer->ListIoCtxWaiting))
     
    28222815            RTMemFree(pMetaXfer);
    28232816        }
    2824         RTCritSectLeave(&pDisk->CritSect);
    28252817    }
    28262818    else if (fFlush)
    28272819        RTMemFree(pMetaXfer);
     2820
     2821    RTCritSectLeave(&pDisk->CritSect);
    28282822
    28292823    return VINF_SUCCESS;
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