VirtualBox

Changeset 39413 in vbox


Ignore:
Timestamp:
Nov 24, 2011 9:51:03 PM (13 years ago)
Author:
vboxsync
Message:

VD: Fix reading wrong data under certain circumstances when using differential images and VMDK, VHD, QED or QCOW images + a fix for a possible lock order violation when a flush request completes

File:
1 edited

Legend:

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

    r38876 r39413  
    17821782    size_t cbToRead     = pIoCtx->Req.Io.cbTransfer;
    17831783    uint64_t uOffset    = pIoCtx->Req.Io.uOffset;
    1784     PVDIMAGE pCurrImage = NULL;
     1784    PVDIMAGE pCurrImage = pIoCtx->Req.Io.pImageCur;;
    17851785    size_t cbThisRead;
    17861786
     
    17881788    do
    17891789    {
    1790         pCurrImage = pIoCtx->Req.Io.pImageCur;
    1791 
    17921790        /* Search for image with allocated block. Do not attempt to read more
    17931791         * than the previous reads marked as valid. Otherwise this would return
     
    18371835        cbToRead -= cbThisRead;
    18381836        uOffset  += cbThisRead;
     1837        pCurrImage = pIoCtx->Req.Io.pImageStart; /* Start with the highest image in the chain. */
    18391838    } while (cbToRead != 0 && RT_SUCCESS(rc));
    18401839
     
    36513650            else
    36523651            {
     3652                RTCritSectLeave(&pDisk->CritSect);
     3653
    36533654                if (pIoCtx->enmTxDir == VDIOCTXTXDIR_FLUSH)
    36543655                {
     
    36663667
    36673668                LogFlowFunc(("I/O context completed pIoCtx=%#p rcReq=%Rrc\n", pIoCtx, pIoCtx->rcReq));
    3668                 RTCritSectLeave(&pDisk->CritSect);
    36693669                pIoCtx->Type.Root.pfnComplete(pIoCtx->Type.Root.pvUser1,
    36703670                                              pIoCtx->Type.Root.pvUser2,
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