chmod:fix file descriptor limits issue#9595
Open
mattsu2020 wants to merge 2 commits intouutils:mainfrom
Open
Conversation
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
1 similar comment
|
GNU testsuite comparison: |
sylvestre
reviewed
Jan 13, 2026
src/uu/chmod/src/chmod.rs
Outdated
|
|
||
| let entries = dir_fd.read_dir()?; | ||
| // Depth-first traversal without recursive calls to avoid stacking FDs. | ||
| let mut stack: Vec<(DirFd, PathBuf)> = vec![(dir_fd, dir_path.to_path_buf())]; |
Contributor
There was a problem hiding this comment.
did you look at the impact on the memory ?
Merging this PR will not alter performance
Comparing Footnotes
|
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
d5cf925 to
dd0f7f4
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
mattsu2020
added a commit
to mattsu2020/coreutils
that referenced
this pull request
Feb 18, 2026
- drop benchmark and CI additions not required for PR uutils#9595 - drop unrelated chown/perms traversal changes - fix safe_traversal tests by passing SymlinkBehavior to DirFd::open
- switch safe recursive chmod traversal to iterative DFS - add DirFd::open_subdir_chain helper for bounded descriptor usage - add unit tests for open_subdir_chain
- add deep-tree and wide-tree recursive chmod tests under NOFILE=64
555d9c2 to
1b31f0f
Compare
|
GNU testsuite comparison: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As mentioned in the comment below, it hits the file descriptor limit.
#9554 (comment)
Make adjustments to reduce the use of FD.