Skip to content

openvmm: pin the comments that scope inode deduplication to a volume - #2062

Merged
Pedro Henrique Penna (ppenna) merged 2 commits into
devfrom
agents/issue-1905-insert-inode-scope
Nov 24, 2026
Merged

Pedro Henrique Penna (ppenna) merged 2 commits into
devfrom
agents/issue-1905-insert-inode-scope

Conversation

@ppenna

@ppenna Pedro Henrique Penna (ppenna) commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1905

What does this pull request change?

It pins microsoft/openvmm#5251, which corrects two doc comments in OpenVMM's vm/devices/virtio/virtiofs/src/lib.rs to say that the virtio-fs server deduplicates inodes only within a volume:

  • The comment of VirtioFs::insert_inode said: "If the file system supports stable inode numbers and an inode already existed with this device and inode number, the existing inode is returned, not the passed in one." It now says that an inode already in the map is a candidate for the inserted inode's host object only if it belongs to the inserted inode's volume (see DedupKey). On a volume with stable file IDs, the host device and inode numbers identify a candidate within that volume; the pair is not a key across volumes, so a host object that two children of an aggregate reach gets a node in each. On a volume without stable file IDs, the path identifies a candidate instead. A candidate of the same file type takes the new name and one more lookup, and is returned; one of another file type held an object that the host has since replaced, so the inserted inode gets a node of its own.
  • The summary of InodeMap said that the map keeps track of in-use inodes "by their actual inode number". It now says that the map indexes the inodes that insertions may reuse by DedupKey.

The OpenVMM commit changes comments only, so nothing that NVX builds or runs behaves differently.

No version is created or bumped: no ABI, machine-contract, time-ABI, snapshot, manifest, saved-state, or protocol version changes, in NVX or in OpenVMM, and no saved-state, snapshot, or on-disk format changes.

Commits:

Start with the two comments in microsoft/openvmm#5251, then compare them with InodeMap::insert, InodeMap::dedup_entry, and InodeMap::reuses in the same file and with DedupKey in inode.rs.

Left out: the inline comment in VirtioFs::create that says the insert "can return an existing inode if it found a match on the inode number" stays, since create inserts an inode of its parent's volume and so states no key across volumes; microvm::fs::insert_inode has no doc comment to change. No NVX documentation changes: section 3.6.4 of doc/design/3.6-host-filesystem.md has stated this invariant since #1875.

Why is this change needed?

#1875 corrected section 3.6.4 of the host filesystem design, which says that the server matches a volume's objects by host device and inode number, or by name on volumes whose inode numbers are not stable, and that an object that matches a node but has another file type gets a node of its own. The source comment of insert_inode still described a match on device and inode number without the volume. That reads as a key over the whole file system, across the children of an aggregate, and leaves out the file type that a match needs and the volumes without stable file IDs, so the two descriptions suggested different invariants to maintainers. The code was already right: both forms of DedupKey hold the volume ID, Ino(volume_id, device_nr, inode_nr) and Path(volume_id, path), and InodeMap::reuses reuses only a candidate of the inserted inode's file type.

As the issue asks, the new comment does not claim that every file system has stable file IDs: lxutil reports them always on Linux, and on Windows only for a file system that can open files by ID (FILE_SUPPORTS_OPEN_BY_FILE_ID).

Upstream main, 5d6ab1cfa, keys stable-ID volumes by (volume ID, inode number) and has both comments, but for the device in that of insert_inode, which the chain's position 329, virtiofs: deduplicate inodes by device and inode number, added. The commit does not apply there as it is, since it changes that comment.

How was this change validated?

Checks and results:

  • OpenVMM, at the pin, with Rust 1.97.1 on Windows 11, local: cargo check, cargo clippy --all-targets, and cargo doc --no-deps for virtiofs, the last with RUSTDOCFLAGS=-D warnings, with and without --document-private-items, which checks the new intra-doc links, are clean, but for the LNK4199 linker message that every linked artifact gets on this machine; cargo nextest run --profile agent -p virtiofs passes, 230 pass and 3 skipped; cargo xtask fmt --fix changes nothing.
  • While developing the OpenVMM commit, a scratch test, not kept, checked the new comment on Windows 11, local: two aggregate children of one directory looked up its file as two nodes, whose inodes have equal device and inode numbers and different volume IDs, while a second lookup through one child returned that child's node.
  • python scripts/local_gates.py --base origin/agents/issue-1904-pci-slot-rollback --only test-changes markdown-links test-layout openvmm-vectors openvmm-cpu-profiles --run on Windows: all five pass.
  • python scripts/openvmm_pin.py check-branch --topic --target origin/agents/issue-1904-pci-slot-rollback and python scripts/openvmm_pin.py check-roadmap --worktree pass; python scripts/openvmm_pin.py source 7e94a090a80de4f5ac08a1ab74d1726da4dcf08b --pr 5251 reports a good signature and the pull request's head; python scripts/nvx.py verify and python scripts/check_markdown_links.py pass.
  • A review of this branch's whole diff, git diff --submodule=diff origin/agents/issue-1904-pci-slot-rollback HEAD, found nothing; a reread of the roadmap's new remark narrowed what it says the summary of InodeMap states, which is folded in.
  • python scripts/openvmm_pin.py land 7e94a090a80de4f5ac08a1ab74d1726da4dcf08b --remote origin, a dry run, finds a fast-forward of feature/microvm/dev.
  • OpenVMM's CI of the pin, run 45271689486: its first attempt lost the runner of build artifacts (for VMM tests) [x64-linux] to a shutdown signal (exit code 143) during cargo build igvmfilegen, which skipped every VMM test, so this pull request's OpenVMM CI of the pinned revision failed on the skipped run vmm-tests [x64-linux-intel-mshv]. The failed jobs' one rerun, the run's second attempt, passed all six jobs that NVX requires: unit tests on x64-linux and x64-windows, and VMM tests on x64-linux-amd-kvm, x64-linux-intel-mshv, x64-windows-intel, and x64-windows-amd. Its SNP and TDX VMM tests, and the openvmm checkin gates summary that they fail, are not among them.
  • NVX CI, run 45274090431 of this head: every job passed in its first attempt, the microVM tests, packages, and platforms on KVM, MSHV, and WHP included, but for OpenVMM CI of the pinned revision and the Required status check that depends on it, which passed in its second attempt, once OpenVMM's rerun had passed.

Backend, host OS, host type, and guest: none locally. The change is comment-only and changes no code that NVX builds or runs, so it needs no local microVM run; the unit tests ran on Windows 11, local, and CI ran the microVM scenarios on KVM and MSHV Linux virtual machines and on WHP Windows virtual machines.

Left to CI: nothing more for this head; the merge group's run checks the change on top of dev.

Checklist

  • Tests cover the new or fixed behavior, in the layout that
    python3 scripts/check_test_layout.py checks.
  • python3 scripts/check_test_changes.py --base origin/dev lists no change
    to an existing test, or a Changes to existing tests section below
    explains each one.
  • The documentation that the change affects is updated, including
    .github/copilot-instructions.md and the skills when a convention or
    workflow changes.
  • A change to the public API of nvx updates nvx/public-api/ with
    python3 scripts/public_api.py --update.
  • Snapshots, protocols, and on-disk formats stay compatible, or the
    description says how the change versions or migrates them.

OpenVMM pin

The comment of OpenVMM's VirtioFs::insert_inode said that, on a file
system with stable inode numbers, an inode that already existed with
the inserted inode's device and inode number was returned instead
(#1905). That reads as a key over the whole file system,
while the virtio-fs server matches a host object only among the inodes
of one volume, by its device and inode numbers on a volume with stable
file IDs and by its path on any other, and reuses only an inode of the
same file type. Section 3.6.4 of the host filesystem design already
says so, since #1875.

Pin microsoft/openvmm 7e94a090a80de4f5ac08a1ab74d1726da4dcf08b, one
commit on e8324ea31, the head of microsoft/openvmm#5249, which NVX
pinned before this commit:

- virtiofs: say that inodes deduplicate only within a volume. The
  comment of insert_inode says that an inode already in the map is a
  candidate for the inserted inode's host object only within its
  volume, so a host object that two children of an aggregate reach
  gets a node in each, and that only a candidate of the same file type
  is reused; InodeMap's summary says that it indexes the inodes that
  insertions may reuse by DedupKey. It changes comments only.

Nothing that NVX runs changes. 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>
…he OpenVMM roadmap

Map position 358, the commit of microsoft/openvmm#5251, which NVX now
pins at 7e94a090a, 232 commits past the mapped tip:

- 358, virtiofs: say that inodes deduplicate only within a volume.
  The comment of VirtioFs::insert_inode says that an inode already in
  the InodeMap is a candidate for the inserted inode's host object
  only within that inode's volume, by its host device and inode
  numbers on a volume with stable file IDs and by its path on any
  other, so a host object that two children of an aggregate reach gets
  a node in each, and that only a candidate of the same file type is
  reused. It said that an inode with the inserted inode's device and
  inode number was returned on a file system with stable inode
  numbers, which reads as a key across volumes. InodeMap's summary
  says that it indexes the inodes that insertions may reuse by
  DedupKey, not that it tracks inodes by their inode number. It
  changes comments only.

Position 358 is not yet assigned to a PR. In lib.rs, it changes the
comment of insert_inode, to which position 329 adds the device, and
upstream's summary of InodeMap; PR06's position 010, PR13's position
048, PR18's positions 081 and 083, PR27's position 126, and eleven
later positions also change the file, none of the lines that the
commit changes. It changes nothing that a mapped PR adds, so it is no
fixup, and it follows position 329. Upstream main, 5d6ab1cfa, keys a
stable-ID volume's inodes by volume ID and inode number and has both
comments, but for the device in that of insert_inode; replaying the
commit there conflicts in that comment, so it cannot go upstream on
its own.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The OpenVMM roadmap documentation update has no active review issues blocking approval.

No open issues 🎉

What changed in this PR

This PR pins OpenVMM’s comment-only clarification that virtio-fs inode deduplication is scoped to a volume, aligning the source documentation with NVX’s filesystem design and addressing #1905. Runtime behavior and compatibility remain unchanged.

Changes:

  • Advances the documented OpenVMM pin to 7e94a090a, chain position 358.
  • Updates roadmap counts, ranges, and the chain diagram.
  • Records the clarification’s scope, dependency on position 329, and upstream applicability.
File Description
doc/​openvmm-upstream-roadmap.md Maps position 358 and explains the volume-scoped inode deduplication comments.

Review effort: Balanced

Base automatically changed from agents/issue-1904-pci-slot-rollback to dev November 23, 2026 22:46
@ppenna
Pedro Henrique Penna (ppenna) added this pull request to the merge queue Nov 23, 2026
Merged via the queue into dev with commit dbf35f1 Nov 24, 2026
93 of 95 checks passed
@ppenna
Pedro Henrique Penna (ppenna) deleted the agents/issue-1905-insert-inode-scope branch November 24, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openvmm: clarify the volume scope of inode deduplication in the insert_inode comment

2 participants