Skip to content

Separate fs resolution from opening; improve perm handling - #1768

Merged
Jay Bosamiya (Microsoft) (jaybosamiya-ms) merged 1 commit into
uliteboxfrom
jayb/ulitebox-backend-resolution-improvements
Oct 31, 2026
Merged

Jay Bosamiya (Microsoft) (jaybosamiya-ms) merged 1 commit into
uliteboxfrom
jayb/ulitebox-backend-resolution-improvements

Conversation

@jaybosamiya-ms

@jaybosamiya-ms Jay Bosamiya (Microsoft) (jaybosamiya-ms) commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

This PR changes the file system backends to support resolving unopened targets. This allows multiple operations to be decoupled from opening, mostly to do with authorization. At its core, the idea is very simple: files/dirs can be resolved, and only resolved files/dirs can be opened; an unopened but resolved file/dir has value in many operations.

Concretely, this means a whole collection of fixups of several seemingly-unrelated issues that each had "local" fixes but instead benefit from this more disciplined fix that fixes the underlying root cause. The fixups:

  • a denied open has no side effects anymore, fixing a long-standing series of O_TRUNC issues, overlay unnecessary-copy up issues, etc.
  • search permissions are checked more precisely, thereby covering foo in foo/../bar too
  • root directory's permissions are finally enforced
  • error ordering/priority is closer to Linux-behavior when multiple errors might be applicable
  • stat no longer needs to open the target
  • overlay checks match merged guest-view, even in presence of self-enforced lower-layer backend
  • mount-hidden files no longer suffer modification
  • symlink in the middle of a path resolves faster

There are known follow ups marked in the code, but this will be part of future PRs, rather than making this big PR even larger.

@jaybosamiya-ms Jay Bosamiya (Microsoft) (jaybosamiya-ms) added the expmt:skipping-stone Tag to quickly find the different PRs as part of the "skipping stone" experiment. label Oct 31, 2026
@jaybosamiya-ms
Jay Bosamiya (Microsoft) (jaybosamiya-ms) force-pushed the jayb/ulitebox-backend-resolution-improvements branch from f1b0012 to 37d312e Compare October 31, 2026 01:07
@jaybosamiya-ms
Jay Bosamiya (Microsoft) (jaybosamiya-ms) marked this pull request as ready for review October 31, 2026 01:23
@jaybosamiya-ms
Jay Bosamiya (Microsoft) (jaybosamiya-ms) removed this pull request from the merge queue due to a manual request Oct 31, 2026
@github-actions

Copy link
Copy Markdown

🤖 SemverChecks 🤖 ⚠️ Potential breaking API changes detected ⚠️

Click for details
--- failure auto_trait_impl_removed: auto trait no longer implemented ---

Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
        ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/auto_trait_impl_removed.ron

Failed in:
  type OverlayWalkingDir is no longer Send, in /home/runner/work/litebox/litebox/litebox_broker_core/src/fs/overlay.rs:80
  type OverlayWalkingDir is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_broker_core/src/fs/overlay.rs:80
  type OverlayWalkingDir is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_broker_core/src/fs/overlay.rs:80

--- failure constructible_struct_adds_field: struct exhaustively constructible through public API adds field ---

Description:
A pub struct that could be exhaustively constructed with a literal using only public API has a new pub field, breaking existing exhaustive literals.
        ref: https://doc.rust-lang.org/reference/expressions/struct-expr.html
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/constructible_struct_adds_field.ron

Failed in:
  field PermissionInfo.on_read_only_fs in /home/runner/work/litebox/litebox/litebox_broker_core/src/fs/backend.rs:565

--- failure enum_missing: pub enum removed or renamed ---

Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/enum_missing.ron

Failed in:
  enum litebox_broker_core::fs::backend::WalkStopReason, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-ulitebox/6c60a1435ab90ffab150a29c4743678f32ecdf73/litebox_broker_core/src/fs/backend.rs:447

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/struct_missing.ron

Failed in:
  struct litebox_broker_core::fs::backend::WalkOutcome, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-ulitebox/6c60a1435ab90ffab150a29c4743678f32ecdf73/litebox_broker_core/src/fs/backend.rs:429
  struct litebox_broker_core::fs::backend::WalkedComponent, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-ulitebox/6c60a1435ab90ffab150a29c4743678f32ecdf73/litebox_broker_core/src/fs/backend.rs:487
  struct litebox_broker_core::fs::backend::WalkingDirHandle, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-ulitebox/6c60a1435ab90ffab150a29c4743678f32ecdf73/litebox_broker_core/src/fs/backend.rs:261
  struct litebox_broker_core::fs::backend::Permissioned, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-ulitebox/6c60a1435ab90ffab150a29c4743678f32ecdf73/litebox_broker_core/src/fs/backend.rs:467

--- failure trait_associated_type_added: non-sealed public trait added associated type without default value ---

Description:
A non-sealed trait has gained an associated type without a default value, which breaks downstream implementations of the trait
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-item-no-default
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/trait_associated_type_added.ron

Failed in:
  trait associated type litebox_broker_core::fs::backend::BackendHandles::ResolvedDir in file /home/runner/work/litebox/litebox/litebox_broker_core/src/fs/backend.rs:255
  trait associated type litebox_broker_core::fs::backend::BackendHandles::ResolvedFile in file /home/runner/work/litebox/litebox/litebox_broker_core/src/fs/backend.rs:257

--- failure trait_method_added: pub trait method added ---

Description:
A non-sealed public trait added a new method without a default implementation, which breaks downstream implementations of the trait
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-item-no-default
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/trait_method_added.ron

Failed in:
  trait method litebox_broker_core::fs::backend::Backend::resolve in file /home/runner/work/litebox/litebox/litebox_broker_core/src/fs/backend.rs:85
  trait method litebox_broker_core::fs::backend::Backend::open_dir in file /home/runner/work/litebox/litebox/litebox_broker_core/src/fs/backend.rs:96
  trait method litebox_broker_core::fs::backend::Backend::open_file in file /home/runner/work/litebox/litebox/litebox_broker_core/src/fs/backend.rs:108
  trait method litebox_broker_core::fs::backend::Backend::resolved_status in file /home/runner/work/litebox/litebox/litebox_broker_core/src/fs/backend.rs:177

--- failure trait_method_missing: pub trait method removed or renamed ---

Description:
A trait method is no longer callable, and may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-item-signature
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/trait_method_missing.ron

Failed in:
  method walk_directories of trait Backend, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-ulitebox/6c60a1435ab90ffab150a29c4743678f32ecdf73/litebox_broker_core/src/fs/backend.rs:76
  method owned_dir_at of trait Backend, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-ulitebox/6c60a1435ab90ffab150a29c4743678f32ecdf73/litebox_broker_core/src/fs/backend.rs:86
  method open_file_at of trait Backend, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-ulitebox/6c60a1435ab90ffab150a29c4743678f32ecdf73/litebox_broker_core/src/fs/backend.rs:104

--- failure trait_removed_associated_type: trait's associated type was removed ---

Description:
A public trait's associated type was removed or renamed.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/trait_removed_associated_type.ron

Failed in:
  associated type BackendHandles::WalkingDirHandle, previously at /home/runner/work/litebox/litebox/target/semver-checks/git-ulitebox/6c60a1435ab90ffab150a29c4743678f32ecdf73/litebox_broker_core/src/fs/backend.rs:253

--- failure trait_requires_more_generic_type_params: trait now requires more generic type parameters ---

Description:
A trait now requires more generic type parameters than it used to. Uses of this trait that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/trait_requires_more_generic_type_params.ron

Failed in:
  trait OverlayWalkingDir (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_broker_core/src/fs/overlay.rs:80

--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---

Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
  Struct OverlayWalkingDir (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_broker_core/src/fs/overlay.rs:80

--- failure type_requires_more_generic_type_params: type now requires more generic type parameters ---

Description:
A type now requires more generic type parameters than it used to. Uses of this type that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/type_requires_more_generic_type_params.ron

Failed in:
  Struct OverlayWalkingDir (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_broker_core/src/fs/overlay.rs:80

Merged via the queue into ulitebox with commit f87ef2a Oct 31, 2026
15 checks passed
@jaybosamiya-ms
Jay Bosamiya (Microsoft) (jaybosamiya-ms) deleted the jayb/ulitebox-backend-resolution-improvements branch October 31, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

expmt:skipping-stone Tag to quickly find the different PRs as part of the "skipping stone" experiment.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant