VirtualBox

Changeset 36136 in vbox


Ignore:
Timestamp:
Mar 3, 2011 9:20:28 AM (14 years ago)
Author:
vboxsync
Message:

Storage: Fix read from wrong snapshots. Happens only with formats which need to read metadata from the disk and for disks with more than 1 snapshot

File:
1 edited

Legend:

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

    r36132 r36136  
    13151315        if (rc == VERR_VD_BLOCK_FREE)
    13161316        {
    1317             for (pCurrImage =  pCurrImage->pPrev;
    1318                  pCurrImage != NULL && rc == VERR_VD_BLOCK_FREE;
    1319                  pCurrImage = pCurrImage->pPrev)
     1317            while (   pCurrImage->pPrev != NULL
     1318                   && rc == VERR_VD_BLOCK_FREE)
    13201319            {
     1320                pCurrImage =  pCurrImage->pPrev;
    13211321                rc = pCurrImage->Backend->pfnAsyncRead(pCurrImage->pBackendData,
    13221322                                                       uOffset, cbThisRead,
     
    29902990    VD_THREAD_IS_CRITSECT_OWNER(pDisk);
    29912991
     2992    Assert(cbRead > 0);
     2993
    29922994    /* Build the S/G array and spawn a new I/O task */
    29932995    while (cbRead)
     
    29993001        cbTaskRead = RTSgBufSegArrayCreate(&pIoCtx->SgBuf, aSeg, &cSegments, cbRead);
    30003002
     3003        Assert(cSegments > 0);
     3004        Assert(cbTaskRead > 0);
    30013005        AssertMsg(cbTaskRead <= cbRead, ("Invalid number of bytes to read\n"));
    30023006
     
    30583062    VD_THREAD_IS_CRITSECT_OWNER(pDisk);
    30593063
     3064    Assert(cbWrite > 0);
     3065
    30603066    /* Build the S/G array and spawn a new I/O task */
    30613067    while (cbWrite)
     
    30673073        cbTaskWrite = RTSgBufSegArrayCreate(&pIoCtx->SgBuf, aSeg, &cSegments, cbWrite);
    30683074
     3075        Assert(cSegments > 0);
     3076        Assert(cbTaskWrite > 0);
    30693077        AssertMsg(cbTaskWrite <= cbWrite, ("Invalid number of bytes to write\n"));
    30703078
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