libkernel: open, stat, lstat, access and unlink on a path through a regular file fail with ENOENT instead of ENOTDIR on Windows #8194
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T02:14:30Z.
Repro
Windows host.
fis a regular file.open("f/child", O_RDONLY),open("f/child", O_RDWR|O_CREAT),stat,lstat,access(…, F_OK),unlink("f/child")and the same withf/child/leaf.Expected (FreeBSD 11.4
vfs_cache_lookup, sys/kern/vfs_cache.c:2105: a lookup in a vnode that is not a directory fails with ENOTDIR): ENOTDIR (20).Actual: ENOENT (2); Linux hosts report ENOTDIR themselves.
mkdir,rmdirandchflagsalready ask for the non-directory prefix.Test:
core/libs/tests/GuestFilesystem.cpp(new cases).Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/enotdir-through-file-fb
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T02:24:43Z.
More calls with the same bug (open, stat, lstat, access and unlink are fixed by #8195): chmod, truncate, utimes and rename in 8199; chdir, remove, opendir, fopen and freopen in 8200. All use the helper from #8195. A trailing-slash path (
file/) is a separate case and is not covered.