Skip to content

file_system: creating a directory again after it was removed clears its removal marker - #9567

Closed
tedin7 wants to merge 2 commits into
ProjectLeonida:mainfrom
tedin7:c2-fs-create-directory-removed-marker
Closed

tedin7 wants to merge 2 commits into
ProjectLeonida:mainfrom
tedin7:c2-fs-create-directory-removed-marker

Conversation

@tedin7

@tedin7 tedin7 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

What

Clear the removal marker after recreating a package directory, preserving markers for deleted children. If marker deletion fails, remove the newly created overlay directory and return the deletion error.

Why

A stale marker leaves the recreated directory hidden. Concurrent RemoveDirectoryW and CreateDirectoryW can race; the file path has the same race and it is outside this change.

Tested

  • AI-assisted change. Synthetic file_system_test on p2 under Wine, no GPU or driver: 455 checks, 6 pre-existing MAXIMUM_ALLOWED failures. With the new test and the previous implementation: 455 checks, 9 failures, including 3 from the held-marker case.
  • git diff --check; check_no_game_data.py on changed source files.

@ItsNotRexed: an exe PR, as you asked.

Claim: #9401 (comment)

@OliverMarcusson

Copy link
Copy Markdown

Tested 6de6f5b (merged cleanly onto main 5d74c272) on Windows 11 10.0.26200 (RTX 5070 Ti), MSVC 19.44 (RelWithDebInfo, Windows SDK 10.0.26100.0): pass.

  • ctest -C RelWithDebInfo -R ^file_system$: 1/1 PASS (457 checks, 0 failures, 0.74 s), including recreated-directory marker cleanup and held-marker rollback.
  • Code read of create_directory looks clean (preserves child deletion markers and rolls back the overlay dir if removing kRemovedDirMarker fails).

AI-assisted (Gemini).

@sodove

sodove commented Nov 23, 2026 •

Copy link
Copy Markdown

checked: native Windows verification for head 6de6f5b on merge b603bb9. Windows 11 x64 build 26100, MSVC 19.44.35220, Windows SDK 10.0.26100, Release.

  • The stock file-system test passed with 457/457 checks. With a marker held open without delete sharing, recreation returned the deletion error, removed the newly created overlay directory, and succeeded after the handle closed.
  • A local extension drove the same code through CreateDirectoryExW with a deleted child file and directory. The parent became visible and lost its own marker. Both children kept their markers and stayed absent from lookups and listings. All 467 checks passed on three runs.
  • Rebuilding the same extended test with only the shim implementation restored to the merge base produced five failures. They covered the two parent-marker clears and the error, rollback and retry checks for the held marker.

Synthetic fixtures only. AI-assisted verification.

@ddaikodaiko

Copy link
Copy Markdown

Windows check of 6de6f5b: Windows 10 Pro 10.0.19045, MSVC 19.44.35229, Windows SDK 10.0.26100, CMake 3.31 + Ninja. No game files.

cmake --build runtime\build --target file_system_test -j 10
ctest --test-dir runtime\build -R "^file_system$" --output-on-failure
  -> 1/1 Test #51: file_system ... Passed 2.24 sec

Recreating a directory after removing it (and the marker-deletion rollback) passes on NTFS here.

@myokex

myokex commented Nov 23, 2026

Copy link
Copy Markdown

Tested 6de6f5b2b merged onto main 5d74c2723 on Windows 11, AMD Radeon RX 7800 XT (driver 32.0.32029.2010), MSVC 2022 RelWithDebInfo, Vulkan SDK 1.4.363.0, synthetic only, no game files: pass.

Full ctest -j8: no new failure. The same 4 fail as on main 5d74c2723 alone fails the same 4 on this card (d3d12_vulkan_device, d3d12_texture_tiles, d3d12_depth_resolve, d3d12_pipeline_library_host: known AMD host issues with open fixes); vk_queue_query_sync also failed once; it is flaky on this card on main too (#6149 fixes it). file_system passes, including the recreate and held-marker checks.

AI-assisted (Claude Code); I read the full diff before building.

@sgonzalez-glitch

Copy link
Copy Markdown

Tested 6de6f5b2b (as part of #9523, #9499, #9567, #9566 and #9328 merged together onto main 5d74c2723) on NVIDIA GeForce RTX 2080, driver 621.24 (32.0.16.2124), Windows 11, MSVC 19.44 RelWithDebInfo: pass.

AI-assisted: yes

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.

7 participants