VirtualBox

Ignore:
Timestamp:
Mar 20, 2010 9:14:43 PM (15 years ago)
Author:
vboxsync
Message:

I/O cache: Increase the endpoint size for every appending write, even if it isn't immediately written to the file (delay in the cache). Fixes data corruption when appending data in VMDK images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PDMAsyncCompletionFile.cpp

    r27495 r27557  
    868868                PPDMACEPFILEMGR pAioMgr = NULL;
    869869
     870                pEpFile->cbEndpoint     = pEpFile->cbFile;
    870871                pEpFile->pTasksFreeTail = pEpFile->pTasksFreeHead;
    871872                pEpFile->cTasksCached   = 0;
     
    970971    AssertRC(rc);
    971972
     973    /* endpoint and real file size should better be equal now. */
     974    AssertMsg(pEpFile->cbFile == pEpFile->cbEndpoint,
     975              ("Endpoint and real file size should match now!\n"));
     976
    972977    /*
    973978     * If the async I/O manager is in failsafe mode this is the only endpoint
     
    10511056    STAM_PROFILE_ADV_STOP(&pEpFile->StatWrite, Write);
    10521057
     1058    /* Increase endpoint size. */
     1059    if (   RT_SUCCESS(rc)
     1060        && ((uint64_t)off + cbWrite) > pEpFile->cbEndpoint)
     1061        ASMAtomicWriteU64(&pEpFile->cbEndpoint, (uint64_t)off + cbWrite);
     1062
    10531063    return rc;
    10541064}
     
    10881098    PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
    10891099
    1090     *pcbSize = ASMAtomicReadU64(&pEpFile->cbFile);
     1100    *pcbSize = ASMAtomicReadU64(&pEpFile->cbEndpoint);
    10911101
    10921102    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