libc: guest path names above NAME_MAX/MAXPATHLEN answer ENOENT instead of ENAMETOOLONG #8163

Closed
opened 2026-10-20 01:03:10 +00:00 by xXPBSXx · 0 comments
xXPBSXx commented 2026-10-20 01:03:10 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T01:03:10Z.


Repro

Windows host. Guest calls stat, open, mkdir, unlink, rmdir, rename or access with a path component of 256 bytes, or a path of 1024 bytes.
Expected (FreeBSD 11.4 namei, sys/kern/vfs_lookup.c:328/525/704): ENAMETOOLONG (63).
Actual: ENOENT (and rename EIO), because the resolved host path does not exist. chflags throws an uncaught filesystem_error once the check exists, as it resolves with the throwing form.
Test: core/libs/tests/GuestPathNameLength.cpp (fails with 0xc0000409 before the fix).
Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/path-name-too-long-fb
AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5934082021 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/8163). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-20T01:03:10Z. --- ### Repro Windows host. Guest calls `stat`, `open`, `mkdir`, `unlink`, `rmdir`, `rename` or `access` with a path component of 256 bytes, or a path of 1024 bytes. Expected (FreeBSD 11.4 namei, sys/kern/vfs_lookup.c:328/525/704): ENAMETOOLONG (63). Actual: ENOENT (and `rename` EIO), because the resolved host path does not exist. `chflags` throws an uncaught `filesystem_error` once the check exists, as it resolves with the throwing form. Test: `core/libs/tests/GuestPathNameLength.cpp` (fails with 0xc0000409 before the fix). Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/path-name-too-long-fb AI-assisted (Claude Code).
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#8163
No description provided.