Skip to content

plan9: allow distinct Plan9 share configurations for the same host path - #2939

Open
Harsh Rawat (rawahars) wants to merge 1 commit into
microsoft:mainfrom
rawahars:distinct_config_per_path
Open

Harsh Rawat (rawahars) wants to merge 1 commit into
microsoft:mainfrom
rawahars:distinct_config_per_path

Conversation

@rawahars

Copy link
Copy Markdown
Contributor

Summary

Earlier, Plan9 shares were deduplicated solely by host path, and each share tracked only one guest mount configuration. Reusing a host path with different read-only or file-access settings therefore caused container creation to fail with a configuration mismatch.

Allow a host path to own multiple configured shares while continuing to reuse equivalent shares. Within each share, reuse and reference-count matching guest mounts while creating independent mounts for different configurations.

Track the exact share and mount selected by each reservation so mapping, cleanup, and retries operate on the correct resources. Use distinct ro/rw guest paths and preserve the filename when mapping a single host file.

Identical configurations retain the existing reuse behavior, while releasing one configuration does not affect other active mappings.

Previous Failure and New Behavior

Before

Two containers in the same LCOW UVM could not mount the same host path with different configurations:

  • Container A: C:\shared/data (rw)
  • Container B: C:\shared/data (ro)

The second request failed with:

cannot reserve ref on share with different config

Now

The same host path can have multiple configured shares:

  • Different configurations, such as ro and rw, use separate shares.
  • Identical configurations reuse existing, reference-counted resources.
  • Releasing one configuration does not affect other active mappings.
  • Single-file mounts target the requested file instead of its parent directory.

Testing

  • Implemented new unit tests
  • On a node with the complete setup, ran the manual tests to validate the new behaviour

Earlier, Plan9 shares were deduplicated solely by host path, and each share tracked
only one guest mount configuration. Reusing a host path with different
read-only or file-access settings therefore caused container creation to
fail with a configuration mismatch.

Allow a host path to own multiple configured shares while continuing to
reuse equivalent shares. Within each share, reuse and reference-count
matching guest mounts while creating independent mounts for different
configurations.

Track the exact share and mount selected by each reservation so mapping,
cleanup, and retries operate on the correct resources. Use distinct ro/rw
guest paths and preserve the filename when mapping a single host file.

Identical configurations retain the existing reuse behavior, while
releasing one configuration does not affect other active mappings.

Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
@rawahars
Harsh Rawat (rawahars) requested a review from a team as a code owner September 21, 2026 13:01
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.

1 participant