VirtualBox

Changeset 44225 in vbox for trunk/src/VBox/Storage/VDI.cpp


Ignore:
Timestamp:
Jan 2, 2013 12:04:04 PM (12 years ago)
Author:
vboxsync
Message:

Storage/VDI: Fix data corruption after a resize if more than 1 block needs to be relocated

File:
1 edited

Legend:

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

    r43602 r44225  
    29492949            do
    29502950            {
    2951                 VDIIMAGEBLOCKPOINTER uBlock = 0;
    2952 
    29532951                /* Allocate data buffer. */
    29542952                pvBuf = RTMemAllocZ(pImage->cbTotalBlockData);
     
    29722970                    for (unsigned idxBlock = 0; idxBlock < cBlocksOld; idxBlock++)
    29732971                    {
    2974                         if (pImage->paBlocks[idxBlock] == uBlock)
     2972                        if (!pImage->paBlocks[idxBlock])
    29752973                        {
    29762974                            /* Read data and append to the end of the image. */
     
    30243022                        break;
    30253023
    3026                     uBlock++;
    30273024                    offStartDataNew += pImage->cbTotalBlockData;
    30283025                }
     
    30733070                /* Update geometry. */
    30743071                pImage->PCHSGeometry = *pPCHSGeometry;
     3072                pImage->cbImage = cbSize;
    30753073
    30763074                PVDIDISKGEOMETRY pGeometry = getImageLCHSGeometry(&pImage->Header);
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