Skip to content

Allow the apply lock owner and its descendants to create placeholders - #2210

Draft
Tyrie Vella (tyrielv) wants to merge 1 commit into
masterfrom
tyrielv/fix-apply-owner-family
Draft

Tyrie Vella (tyrielv) wants to merge 1 commit into
masterfrom
tyrielv/fix-apply-owner-family

Conversation

@tyrielv

Copy link
Copy Markdown
Contributor

Problem and Context

Plain git apply fails with No such file or directory for a tracked file that remains fully virtual. GVFS rejects placeholder creation under the apply lock, including requests from the Git process that owns the lock.

A command-wide exemption also permits unrelated processes to create placeholders during patch writes. A requester-specific exemption must avoid another failure: ProjFS caches FileNotFound by path, so an unrelated reader can hide the file from Git.

This change fixes placeholder admission for worktree-only apply. Separate Git defects in --index, --3way, and --cached remain outside this change.

Changes

  • Permit placeholder creation only for the apply lock owner and its descendants. Reuse the ancestry cache and process-start identity checks.
  • Apply the same permission to immediate requests, wait-enabled requests, queued requests, and the final queued creation lease.
  • Evaluate the lease permission outside the lock acquisition gate. Recheck the lock owner before the lease starts.
  • Return STATUS_FILE_NOT_AVAILABLE for apply-specific denials, including unknown ancestry, so these requests do not cache false absence. Keep the default wait budget at zero.
  • Preserve the policies for other Git commands, including the command-wide add/stage, mv, and status allowances and the folder and special-file exemptions.
  • Add unit tests for owner and descendant access, unrelated and unknown requesters, PID reuse, owner replacement, and queued lease rechecks.
  • Add functional tests for virtual, placeholder, and hydrated files, patch paths and stdin, a real child hook, and unrelated same-path readers. The tests also compare mixed patches, reverse patches, deletions, and overwrite rejection with a normal Git repository.

Reuse identity-validated ancestry for apply placeholder admission and queued creation leases. Return a transient error for denied apply requests so ProjFS does not cache false absence for the lock owner. Preserve the existing policies for other Git commands and the zero default wait budget.

Add unit tests for process-family admission, unknown identities, owner replacement, and queued rechecks. Add functional tests for plain apply, real child hooks, overlapping readers, and patch parity with a normal Git repository.

Assisted-by: GPT-6.1 Sol
Signed-off-by: Tyrie Vella <[email protected]>
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