VirtualBox

Changeset 23959 in vbox


Ignore:
Timestamp:
Oct 22, 2009 8:38:31 AM (15 years ago)
Author:
vboxsync
Message:

PDMAsyncCompletion: Disable async I/O on linux if opening fails because it needs O_DIRECT too. Disable async I/O and enable the host cache if a request fails and the endpoint is migrated to a failsafe manager

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

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

    r23958 r23959  
    555555    PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
    556556    PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pEndpoint->pEpClass;
     557    bool fUseFailsafeManager = pEpClassFile->fFailsafe;
    557558
    558559    AssertMsgReturn((fFlags & ~(PDMACEP_FILE_FLAGS_READ_ONLY | PDMACEP_FILE_FLAGS_CACHING)) == 0,
     
    610611         *
    611612         * On Linux we have the same problem with cifs.
    612          * Shouldn't be a big problem here either because
    613          * it's a network filesystem and the data is on another
    614          * computer.
     613         * Have to disable async I/O here too because it requires O_DIRECT.
    615614         */
    616615        fFileFlags &= ~RTFILE_O_NO_CACHE;
     616
     617#ifdef RT_OS_LINUX
     618        fFileFlags &= ~RTFILE_O_ASYNC_IO;
     619        fUseFailsafeManager = true;
     620#endif
    617621
    618622        /* Open again. */
     
    644648                pEpFile->cTasksCached = 0;
    645649
    646                 if (pEpClassFile->fFailsafe)
     650                if (fUseFailsafeManager)
    647651                {
    648652                    /* Safe mode. Every file has its own async I/O manager. */
    649                     rc = pdmacFileAioMgrCreate(pEpClassFile, &pAioMgr, false);
     653                    rc = pdmacFileAioMgrCreate(pEpClassFile, &pAioMgr, true);
    650654                    AssertRC(rc);
    651655                }
  • trunk/src/VBox/VMM/PDMAsyncCompletionFileNormal.cpp

    r23956 r23959  
    880880                            PPDMACEPFILEMGR pAioMgrFailsafe;
    881881
     882                            LogRel(("%s: Request %#p failed with rc=%Rrc, migrating endpoint %s to failsafe manager.\n",
     883                                    RTThreadGetName(pAioMgr->Thread), pTask, rcReq, pEndpoint->Core.pszUri));
     884
    882885                            pEndpoint->AioMgr.fMoving = true;
    883886
     
    887890
    888891                            pEndpoint->AioMgr.pAioMgrDst = pAioMgrFailsafe;
     892
     893                            /* Update the flags to open the file with. Disable async I/O and enable the host cache. */
     894                            pEndpoint->fFlags &= ~(RTFILE_O_ASYNC_IO | RTFILE_O_NO_CACHE);
    889895                        }
    890896
     
    974980                            else if (RT_UNLIKELY(!pEndpoint->AioMgr.cRequestsActive && pEndpoint->AioMgr.fMoving))
    975981                            {
    976                                 /* If we the endpoint is about to be migrated do it now. */
     982                                /* If the endpoint is about to be migrated do it now. */
    977983                                bool fReqsPending = pdmacFileAioMgrNormalRemoveEndpoint(pEndpoint);
    978984                                Assert(!fReqsPending);
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