VirtualBox

Changeset 85491 in vbox for trunk/src/VBox/Runtime/r3/linux


Ignore:
Timestamp:
Jul 28, 2020 4:31:44 PM (4 years ago)
Author:
vboxsync
Message:

IPRT/RTFileCopyPartEx-linux.cpp: Fix fallback handling if the syscall is present but cannot handle the copying (it is documented that for a range of kernels it cannot handle cross-filesystem copying).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/linux/RTFileCopyPartEx-linux.cpp

    r82968 r85491  
    124124    AssertReturn(pBufState->uMagic == RTFILECOPYPARTBUFSTATE_MAGIC, VERR_INVALID_FLAGS);
    125125    if (pBufState->iAllocType == -42)
    126     { /* more and more likley as time goes */ }
     126    { /* more and more likely as time goes */ }
    127127    else
    128128        return rtFileCopyPartExFallback(hFileSrc, offSrc, hFileDst, offDst, cbToCopy, fFlags, pBufState, pcbCopied);
     
    155155            Assert(rc != 0);
    156156            rc = rc != 0 ? RTErrConvertFromErrno(rc) : VERR_READ_ERROR;
    157             break;
     157            if (rc != VERR_NOT_SAME_DEVICE || cbCopied != 0)
     158                break;
     159
     160            /* Fall back to generic implementation if the syscall refuses to handle the case. */
     161            rc = rtFileCopyPartPrepFallback(pBufState, cbToCopy);
     162            if (RT_SUCCESS(rc))
     163                return rtFileCopyPartExFallback(hFileSrc, offSrc, hFileDst, offDst, cbToCopy, fFlags, pBufState, pcbCopied);
     164            return rc;
    158165        }
    159166        Assert(offThisSrc == offSrc + (int64_t)cbCopied + cbActual);
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