Repository navigation
openvmm: pin the ENOSYS reply to FUSE_COPY_FILE_RANGE_64 - #2069
Merged
Pedro Henrique Penna (ppenna) merged 3 commits intoNov 24, 2026
Merged
Conversation
OpenVMM's FUSE session did not know FUSE_COPY_FILE_RANGE_64, opcode 53, which Linux 6.18 sends first for each copy_file_range(2) on a virtio-fs share, whatever protocol version the session negotiated (#1899). Its catch-all for unknown opcodes failed the request with EINVAL, so the system call failed in NVX's 6.18.38 guests, whereas only ENOSYS makes Linux resend the copy as FUSE_COPY_FILE_RANGE and, after ENOSYS to that one too, copy the data itself. Pin microsoft/openvmm be75ab532b77ce90fa46371f2ced3cb547fd00c7, one commit on 5e0e72d72, the head of microsoft/openvmm#5254, which NVX pins below this commit: - fuse: fail FUSE_COPY_FILE_RANGE_64 with ENOSYS, not EINVAL. The session decodes opcode 53 as it decodes FUSE_COPY_FILE_RANGE and fails it with ENOSYS without calling the file system, which keeps answering FUSE_COPY_FILE_RANGE alone, as Fuse::copy_file_range now documents. A short request still fails with EINVAL. Its two tests fail without the fix, with EINVAL instead of ENOSYS, and pass with it, on Windows. Two copy_file_range(2) calls of 1 MiB in a 6.18.38 guest on WHP failed with EINVAL before the fix and copied the file after it, with the guest's own copy once both variants had failed with ENOSYS. The session still negotiates protocol 7.39. No saved-state, protocol, or ABI format, and no version of any of them, changes. The protocol vectors and CPU profiles that nvx copies are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Section 3.6.3 names COPY_FILE_RANGE among the operations that the server fails with ENOSYS, but Linux 6.18 sends each copy first as COPY_FILE_RANGE_64, which the server failed with EINVAL until the pin of the previous commit (#1899), so the guest's copy_file_range(2) failed instead of falling back. Say that both wire variants fail with ENOSYS, and how Linux falls back from the first to the second and then to a copy that it makes itself. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…oadmap Map position 365, the commit of microsoft/openvmm#5255, which NVX now pins at be75ab532, 239 commits past the mapped tip: - 365, fuse: fail FUSE_COPY_FILE_RANGE_64 with ENOSYS, not EINVAL. The session decodes opcode 53 as it decodes FUSE_COPY_FILE_RANGE and fails it with ENOSYS in Session::dispatch_helper, without calling the file system. Since 6.18, Linux sends each copy as that opcode first, and only ENOSYS makes it fall back to FUSE_COPY_FILE_RANGE and then to its own copy; the catch-all of upstream's FuseOperation::read failed it with EINVAL, so the copy failed in NVX's 6.18.38 guests. Position 365 is not yet assigned to a PR. It declares the opcode in protocol.rs, which no earlier position changes, adds it to the operation table of request.rs, whose request checks positions 318 and 319 change, adds its arm between upstream's in dispatch_helper, and documents it on Fuse::copy_file_range in lib.rs, after position 327's paragraph; its tests, registered before position 323's error_reply, use the session's test harness of positions 321, 322, and 325 and position 327's reply to FUSE_COPY_FILE_RANGE. It is not a fixup: no earlier position handles the opcode, and the catch-all is upstream's. Upstream main, 5d6ab1cfa, lacks the opcode too and fails it the same way, but replaying the commit there conflicts in lib.rs and session.rs, which lack position 327's paragraph and the session's test modules, so it cannot go upstream on its own. The Scope now names 09966aa63, position 361, as the head of feature/microvm/dev, since microsoft/openvmm#5251, microsoft/openvmm#5252, and microsoft/openvmm#5253 landed positions 358-361 there too. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the filesystem documentation and OpenVMM roadmap updates.
No open issues 🎉
What changed in this PR
This PR addresses #1899 by pinning OpenVMM’s ENOSYS response to unsupported FUSE_COPY_FILE_RANGE_64 requests, allowing Linux 6.18 guests to fall back to copying data themselves.
Changes:
- Documents both FUSE copy variants and Linux’s fallback sequence.
- Maps OpenVMM chain position 365 and updates the roadmap’s pin, counts, and dependency analysis.
| File | Description |
|---|---|
doc/openvmm-upstream-roadmap.md |
Records the new OpenVMM pin and maps the copy-operation fix. |
doc/design/3.6-host-filesystem.md |
Explains unsupported copy responses and Linux’s fallback behavior. |
Review effort: Balanced
5 tasks done
Base automatically changed from
agents/issue-1901-snapshot-replaced-path
to
dev
November 24, 2026 03:45
Pedro Henrique Penna (ppenna)
deleted the
agents/issue-1899-copy-file-range-64
branch
November 24, 2026 04:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1899
What does this pull request change?
A
copy_file_range(2)between two files of a virtio-fs share no longer failswith
EINVALin a Linux 6.18 guest, such as NVX's 6.18.38 one. Linux now fallsback to a copy that it makes itself.
openvmm: pin the ENOSYS reply to FUSE_COPY_FILE_RANGE_64)moves the
openvmmgitlink to [DO NOT REVIEW] fuse: fail FUSE_COPY_FILE_RANGE_64 with ENOSYS, not EINVAL openvmm#5255. Its one commit,fuse: fail FUSE_COPY_FILE_RANGE_64 with ENOSYS, not EINVAL, makes OpenVMM'sFUSE session decode
FUSE_COPY_FILE_RANGE_64(opcode 53) the way it decodesFUSE_COPY_FILE_RANGE(opcode 47), and fail it withENOSYSwithout callingthe file system.
Fuse::copy_file_rangekeeps answeringFUSE_COPY_FILE_RANGEalone, as its documentation now says. A short requeststill fails with
EINVAL, as every malformed request does.doc: say that both FUSE copy variants fail with ENOSYS): §3.6.3 ofdoc/design/3.6-host-filesystem.mdnow says that bothwire variants of a copy fail with
ENOSYS. It also says how Linux falls backfrom
COPY_FILE_RANGE_64toCOPY_FILE_RANGEand then to its own copy.doc: map the ENOSYS reply to FUSE_COPY_FILE_RANGE_64 in the OpenVMM roadmap): maps chain position 365, after 1901's positions 362-364.Start with the OpenVMM commit (
git diff --submodule=diff origin/agents/issue-1901-snapshot-replaced-path HEAD), then the design-documentparagraph.
Left out:
Fuse::copy_file_range, and the issue does not require it.EINVAL.Separate bug, not fixed here:
FUSE_TMPFILE(opcode 51) also reaches thatcatch-all and fails with
EINVAL. Linux 6.18'sfuse_tmpfileturns onlyENOSYSintoEOPNOTSUPP(and setsno_tmpfile). Soopen(2)withO_TMPFILEon a share fails withEINVALinstead ofEOPNOTSUPP, which isthe error that applications check before they fall back. Both WHP guest runs
below show it. libfuse and virtiofsd fail unknown opcodes with
ENOSYS.Why is this change needed?
Since 6.18,
__fuse_copy_file_rangeinfs/fuse/file.csends each copy asFUSE_COPY_FILE_RANGE_64, opcode 53 of protocol 7.45, whatever minor versionthe session negotiated (OpenVMM negotiates 7.39). Linux handles the reply as
follows:
-ENOSYS: Linux setsno_copy_file_range_64and resends the copy asFUSE_COPY_FILE_RANGEfor the rest of the connection. If that one also gets-ENOSYS, Linux setsno_copy_file_range, andfuse_copy_file_rangecopieswith
splice_copy_file_range.again.
OpenVMM's session did not know opcode 53. The catch-all of
FuseOperation::readlogged "Invalid opcode" and failed the request withEINVAL.FUSE_COPY_FILE_RANGE, by contrast, reachesFuse::copy_file_range,whose default, which
VirtioFskeeps, isENOSYS. #1864 fixed the size of alegacy copy's reply, not the newer opcode. Upstream OpenVMM
mainhas the samecatch-all and lacks the opcode too.
Alternatives rejected:
Fuse::copy_file_rangewith a 64-bitfuse_copy_file_range_outreply. No file system implements copying, so itwould add an untested reply path without changing any behavior. Linux
already clamps the legacy request to what its
u32reply can count.ENOSYS. That would also changeFUSE_TMPFILEand every future opcode, which is beyond this issue; it isleft for the separate bug above.
How was this change validated?
Checks and results:
OpenVMM, on Windows, at the pinned
be75ab532:cargo check -p fusecargo clippy --all-targets -p fusecargo clippy --all-targets -p fuse --target x86_64-unknown-linux-gnucargo doc --no-deps -p fusecargo nextest run --profile agent -p fusecargo check --all-targets -p virtiofscargo xtask fmt --fixThe two new tests,
copy_64_fails_as_the_legacy_copy_doesandlegacy_copy_copies_after_copy_64_fails, fail without the fix, with only theopcode's constant declared (
left: Err(EINVAL (22)),right: Err(ENOSYS (38))). That holds at899dcd63fand atb2ac1073d. They pass with the fix.NVX:
python scripts\nvx.py verifycargo test --locked --manifest-path nvx/Cargo.toml --no-default-features --test openvmm_vectors -- --ignoredcargo test --locked --manifest-path nvx/Cargo.toml --no-default-features --test openvmm_cpu_profiles -- --ignoredpython scripts\openvmm_pin.py source be75ab532b77ce90fa46371f2ced3cb547fd00c7 --pr 5255python scripts\openvmm_pin.py check-branch --topic --target origin/agents/issue-1901-snapshot-replaced-pathpython scripts\openvmm_pin.py check-roadmap --worktreepython scripts\check_markdown_links.pypython scripts\check_test_changes.py --base origin/agents/issue-1901-snapshot-replaced-pathpython scripts\check_test_layout.pynvx-cligate (python -m unittest ...,test_adversarial.py,nvx.py ... --help)NVX CLI / WindowsandNVX CLI / Linuxpassed in run 45294580049git diff --checkBackend, host OS, host type, and guest:
Guest probe: a static binary that calls
copy_file_range(2)twice, copying a1 MiB random file on the share to a new file, then opens an
O_TMPFILE. It ranin NVX's Linux 6.18.38 guest (
nvx0.1.0 kernel and initramfs, 256 MiB), withOpenVMM's FUSE trace on.
copy_file_range(2)0.5.0+g09524b79c, whosefuseandvirtiofssources match899dcd63f(before)-1,EINVAL, twiceEINVAL0.5.0+g0202d795b, the same patch on899dcd63f(after)1048576, twiceCopyFileRange64->ENOSYS,CopyFileRange->ENOSYS, then the guest's copy; no copy request for the second callnvx-kvm-test, Linux, virtual machine09524b79crelease (before)-1,EINVAL, twiceEINVALCI of this head:
passed: the microVM tests on Linux/KVM, Linux/MSHV, and Windows/WHP,
NVX CLIon Linux and Windows, the packages, andOpenVMM CI of the pinned revision. Its first attempt failed only that last job: it foundOpenVMM's Linux vmm-tests skipped after a transient failure,
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALLfrompackages.microsoft.cominresolve mshv boot payloads. I reranOpenVMM's failed jobs once, then this job.
passed the six jobs that NVX requires for
be75ab532:unit tests [x64-linux],unit tests [x64-windows], andrun vmm-testsonx64-linux-amd-kvm,x64-linux-intel-mshv,x64-windows-intel, andx64-windows-amd. Itsx64-windows-amd-snpvmm-tests, which also failon [DO NOT REVIEW] virtiofs: keep the node that a LINK returns until the guest forgets it openvmm#5253 and #5254, fail one VMGS test, and its
x64-windows-intel-tdxvmm-tests exit with code 127 before any test;NVX requires neither.
Not run: a Linux run of the regression tests and of the KVM guest probe with
the fix.
nvx-kvm-testandnvx-mshv-testhave been unreachable over SSHsince 11:38 today. NVX CI's Linux microVM tests ran the exact pin.
Checklist
python3 scripts/check_test_layout.pychecks.python3 scripts/check_test_changes.py --base origin/devlists no changeto an existing test, or a Changes to existing tests section below
explains each one.
.github/copilot-instructions.mdand the skills when a convention orworkflow changes.
nvxupdatesnvx/public-api/withpython3 scripts/public_api.py --update.description says how the change versions or migrates them.
No version is created or bumped. The session still negotiates FUSE protocol
7.39, and no saved-state, snapshot, manifest, ABI, or protocol format or
version changes.
nvxis unchanged, so its public API is too.OpenVMM pin
be75ab532b77ce90fa46371f2ced3cb547fd00c7, with a good signature. It is onecommit on
5e0e72d72, the head of [DO NOT REVIEW] virtiofs: fail a microVM save while the guest holds a replaced object openvmm#5254 (openvmm: virtiofs saves a snapshot it cannot restore after the host replaces a referenced path #1901). It ispatch-identical (
git range-diff) to0202d795b, the same commit on899dcd63f.#5254 have landed, and
feature/microvm/devis at5e0e72d72, position 364,the parent of the pin.
python scripts\openvmm_pin.py land be75ab532b77ce90fa46371f2ced3cb547fd00c7 --remote origin(a dry run) finds a fast-forward. The roadmap's Scope still names
09966aa63, the head offeature/microvm/devwhen it was written.commit on upstream main
5d6ab1cfaconflicts infuse'slib.rsandsession.rs, so it cannot go upstream on its own.agents/issue-1901-snapshot-replaced-path, isthis pull request's base. Only the top three commits belong to this pull
request.
(openvmm: pin the nodes that LINK replies keep until the guest forgets them #2065) → 1901 (openvmm: pin the virtio-fs saves that refuse replaced objects #2068) → 1899 (this pull request). Land [DO NOT REVIEW] fuse: fail FUSE_COPY_FILE_RANGE_64 with ENOSYS, not EINVAL openvmm#5255 first,
by fast-forwarding
feature/microvm/devto exactlybe75ab532b77ce90fa46371f2ced3cb547fd00c7, after [DO NOT REVIEW] virtiofs: fail a microVM save while the guest holds a replaced object openvmm#5254.The merge button squashes and would leave the pin off the branch.