Repository navigation
fix(libkernel): lutimes reports ENOTDIR for a path through a file - #11218
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head 4dc65b0c6f40746db22cd45dcada465ca5801805. The one-line change applies the same ENOENT translation already used by utimes to lutimes; the added tests cover paths through a regular file and Windows file links, plus link-vs-target timestamp behavior. The PR documents the remaining dangling-link limitation.
Current-main conventions and git diff --check pass. The latest hosted conventions, eligibility, intake, labels and report checks pass; product build jobs are skipped by path policy. The Windows timestamp tests and full-suite comparison are author-reported; I could not rerun them in this environment. I found no concrete issue in the reviewed change. I’m leaving this as a COMMENTED review because the PR is still marked draft.
MarcZX10
left a comment
There was a problem hiding this comment.
Correction to my prior review: the PR was marked ready at 22:07:39, before I submitted my 22:08:16 COMMENTED review. My statement that it was still a draft was stale.
I reviewed exact head 4dc65b0c6f8.... The change applies the same ENOENT translation already used by utimes to lutimes; the new tests exercise paths through files and Windows links, and the PR documents the remaining dangling-link limitation. Current-main conventions and git diff --check pass. Hosted eligibility, conventions, intake, labels and report checks pass; product build jobs are skipped by path policy. The Windows tests and full-suite comparison are author-reported and I could not rerun them here. I found no concrete issue in the changed behavior.
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Windows and Linux runs of head
AI-assisted: yes (Claude Code); results above were run on this machine. |
What
lutimeson a path whose parent is a regular file, or a link to a regular file (file/child,file-link/child), failed withENOENT. FreeBSD 11.4'skern_lutimesdoes anameilookup withNOFOLLOW, which fails withENOTDIRwhen a non-final component is not a directory (the link is followed because it is not the final component).utimesandsceKernelUtimesalready map the Windows "not found" result throughNotFoundError_nid_no_patch, which givesENOTDIRhere;lutimesskipped that mapping. It now uses the same one-line mapping.I also probed
truncate,utimesandlutimesthrough Windows file links, directory links, dangling links and link loops against the same source:truncatefollows links (file link truncates the target, directory linkEISDIR, danglingENOENT, loopELOOP),utimesfollows links, andlutimeschanges the link itself, including a dangling link and a loop. All of those already matched, so only theENOTDIRmapping changes.Known limit:
NotFoundError_nid_no_patchtreats a dangling Windows link in a non-final position as an existing non-directory (MinGWstd::filesystem::statusdoes not see Windows links), solutimes("dangling-link/child")now givesENOTDIRwhere FreeBSD givesENOENT.utimes,truncate,chmodandlstatalready behave this way through the same helper onmain; fixing the helper is a separate follow-up PR that changes all of them together.Tested
Windows 11 (10.0.26200), WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
-DBUILD_TESTING=ON, onmaina940685.guest_file_timestamps: new checks forutimesandlutimesonfile/child(ENOTDIR), and, where Windows links can be created,utimesthrough a file link and a directory link,utimeson a dangling link (ENOENT),lutimeson a directory link and a dangling link (changes the link, not the target), and both calls onfile-link/child(ENOTDIR). Onmainthe test fails (ENOENTwhereENOTDIRis expected); with this change it passes, three runs out of three.pr_overlap_encoding,agc_host_import_cut_lifetimeandagc_driver_depth_plane_partial_store, which fail onmainin this environment too.python tools/check_conventions.py --base upstream/main: passes.Overlaps
tools/pr_overlap.pyreports no line overlap. It could not compareStdio.cppagainst 11 older pull requests that conflict withmainthemselves (#5021, #6936, #7121, #7201, #7447, #8520, #9284, #9293, #9297, #9302, #9823). #9374 changes the link creation in thelutimespart of the same test file; the new checks here are in a separate block at the end ofmain.Checklist
main; no other open PR implements the same functionNotImplemented_nid_no_patch); no silent stubs added.mdfiles or images added to the repositoryAI-assisted (Claude Code).
🤖 Generated with Claude Code