Repository navigation
VFS: a write below a missing parent fails with ERROR_PATH_NOT_FOUND instead of conjuring the folder - #1259
VFS: a write below a missing parent fails with ERROR_PATH_NOT_FOUND instead of conjuring the folder#1259pickles976 wants to merge 1 commit into
Conversation
…lder prepare_write create_dir_all'd the overlay parent with no merged-view check, so CreateFileW CREATE_ALWAYS on G:\nodir\f.bin created 'nodir' where Win32 fails with ERROR_PATH_NOT_FOUND, and a write below a removed directory resurrected the folder through commit_write's remove_whiteout. stage_write (copy/move) already had exactly this guard, so CreateFileW and CopyFileW disagreed on the same path. Same case as reported in xcl-dev#577 (third-party static find); the create_dir multi-level behaviour is deliberately untouched - the 'directories' test codifies multi-level creation as the contract, and that is a separate maintainer call (see the xcl-dev#577 comment).
|
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on Three more than the baseline; a write below a missing parent failing with the right error is covered and green. Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it. |
|
Thanks @dcastell1 — full-workspace green on native Windows (754 vs 751 baseline) is stronger unit evidence than my Wine cross-run, and the clean-patch/revert discipline is noted.\n\nTo the maintainers: the two |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Sequencing note for the reviewer from my side of the VFS lane: #1362 (staged whiteout preservation) and this PR are complementary halves of the same #577 third-party audit — theirs fixes failed-open resurrection, this one missing-parent conjuring. The textual conflict is one renamed function: my guard slots at the top of |
|
Regression run of Against the limits in CONTRIBUTING.md: 100 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
What:
prepare_writerancreate_dir_allon the overlay parent with no merged-view check. SoCreateFileW("G:\nodir\f.bin", CREATE_ALWAYS)— parent in neither layer — creatednodirand succeeded where Windows failsERROR_PATH_NOT_FOUND; and a write below a removed directory resurrected the folder viacommit_write → remove_whiteout(children staying whited out).stage_write(the copy/move path) already carries exactly the guard being added here, so the two entry points currently disagree on the same path. Found by @emirduran707's static audit (their #577 comment, 11:53Z); this implements theprepare_writehalf of their suggested fix.What is in it
prepare_write: reject withERROR_PATH_NOT_FOUNDunless the virtual parent is a folder in the merged view (is_dir, matchingstage_write's check line-for-line) — before anything is created on disk;create_dir_allwas there for).create_dirmulti-level case from the same report —vfs::tests::directoriescodifies multi-level creation as the contract (create_dir("saves\slot1") == Ok(())), and whether the emulated console should matchCreateDirectoryW's one-level semantics is a maintainer call, not a silent test rewrite. Details in my VFS: CREATE_ALWAYS on a game directory, or a write below a game file, leaves an overlay entry that hides the original #577 reply.Tested
x86_64-pc-windows-gnu(llvm-mingw toolchain, clang+lld, static libunwind), release test profile, rustc stable; lib tests executed under Wine 9 (wineviaCARGO_TARGET_..._RUNNER):cargo test -p xcl --lib vfs::tests --target x86_64-pc-windows-gnu -- --test-threads=1: 15 passed, 0 failed, 0 ignored (12 pre-existing + 3 new; no GPU tests in the filtered set). The fullcargo test --workspacefrom Linux requires the same cross + Wine setup (lib does not link natively here —retour); CI covers the workspace.Regression run
Requesting the
test-onlylabel: CPU-only host, no title package or Windows desktop here, so nosmoke.ps1blocks — same lane @ryosen0 used with the recent VFS PR; happy to have it smoke-partnered if a reviewer wants title evidence beyond the unit level.Not tested
smoke.ps1on a real title (see above); thevfs_hooksCreateFileW end-to-end path under Wine (the two known Wine-9CopyFile2blockers in that suite are unrelated to this change and still abort on base).AI use