Repository navigation
ln: create links through the open target directory - #15524
abendrothj wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
GNU testsuite comparison: |
Merging this PR will improve performance by 6.11%1 warning, 1 note
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
71a3e69 to
f6794f9
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
This comment was marked as resolved.
This comment was marked as resolved.
f6794f9 to
eb937fb
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
eb937fb to
f36e668
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Binary size comparison: |
Move the temporary name and renameat logic of replace_link into DirFd::replace_entry_at, which creates the entry through a callback relative to the directory, so other callers can replace entries the same way. The parent is now opened with DirFd::open_anchor, so ln -sf and cp -sf replacing an entry in a directory with write and search but no read permission work, as they do with GNU, instead of failing with EACCES.
f36e668 to
c30e23a
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Based on #15122; only the last commit is new here (+278/−49).
Closes #15523
With a target directory, ln checked it once and then created each link and renamed each backup by joining the directory's path, so a rename of that path in between sent the remaining links elsewhere.
ln now opens the target directory once and does everything relative to it: the existence check, choosing a backup name, the backup rename, and creating or replacing the link.
.,..and/as sources resolve as before. The-rlink text and the same-file checks still use the path. uucore getsbackup_control::get_backup_path_with_exists, so numbered backup names are checked in the same directory, andfs::link_atbecomes public.On macOS, a target directory without search permission now fails once with "failed to access" instead of once per source. Linux opens it with
O_PATH, so nothing changes there.Checked against GNU 9.12 with the target renamed while ln waits at an
-iprompt, with and without--backup: links and backups stay in the original directory, as in GNU. Addedtest_target_dir_renamed_during_prompt, which fails without the change on macOS and Linux, andtest_target_dir_backup_source_without_basenamefor sources without a basename.