Uh oh!
There was an error while loading. Please reload this page.
Mount at /run/virtiofs only what containers bind from there - #861
Closed
MayCXC wants to merge 1 commit into
Closed
Conversation
4 tasks
A container's additional virtiofs mounts are bind-mounted into it from /run/virtiofs/<tag>, so those tags are what belongs there. A virtiofs rootfs is mounted at the container's own rootfs path and nothing binds it, but the per-tag boot walks put its tag under /run/virtiofs anyway, and the hotplug join counted it as satisfying /run/virtiofs for every other container. A container joining with a directory another container boots from was skipped as already mounted, and its bind failed with ENOENT at start. Deriving the boot walks and the join's already-mounted set from the additional mounts alone makes /run/virtiofs and the set that describes it the same thing. The colliding join then mounts the tag itself, which the guest kernel allows: virtio_fs_get_tree resolves each mount of a tag to the device instance's one superblock (fs/fuse/virtio_fs.c, sget_fc with virtio_fs_test_super), so a tag mounts at any number of places.
MayCXCforce-pushed
the
virtiofs-tag-collision
branch
from
August 27, 2026 20:47
32158dc to
54494c7Compare
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 freeto 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.
Summary
A container's additional virtiofs mounts are bind-mounted into it from
/run/virtiofs/<tag>, so those tags are what belongs there. A virtiofs rootfs is mounted at the container's own rootfs path and nothing binds it, but the per-tag boot walk put its tag under/run/virtiofsanyway, and the hotplug join counted it as satisfying/run/virtiofsfor every other container. A container joining with a directory another container boots from was skipped as already mounted, and its bind failed withENOENTat start.Deriving the boot walks and the join's already-mounted set from the additional mounts alone makes
/run/virtiofsand the set that describes it the same thing. The colliding join then mounts the tag itself, which the guest kernel allows:virtio_fs_get_treeresolves each mount of a tag to the device instance's one superblock (fs/fuse/virtio_fs.c,sget_fcwithvirtio_fs_test_super), so a tag mounts at any number of places.Closes#860.
Motivation and Context
The bug needs two containers in one pod and a shared host directory to show up: one booting from it, another mounting it. That is a reasonable thing to arrange, and the failure gives no hint of the cause, since the container that fails is not the one holding the tag.
The underlying confusion is that two different sets were being described by one name.
/run/virtiofsis where binds come from; the set of tags that need to be there is the additional mounts. Deriving one from the other keeps them from drifting apart.Testing
swift buildandmake checkclean.swift test: 603 tests in 83 suites passed.Type of Change