Skip to content

install: fix EEXIST race losing files in parallel install -D#12429

Open
eyupcanakman wants to merge 2 commits into
uutils:mainfrom
eyupcanakman:fix/install-d-eexist-race-12355
Open

install: fix EEXIST race losing files in parallel install -D#12429
eyupcanakman wants to merge 2 commits into
uutils:mainfrom
eyupcanakman:fix/install-d-eexist-race-12355

Conversation

@eyupcanakman
Copy link
Copy Markdown
Contributor

Fixes #12355.

Concurrent install -D invocations sharing parent directories race in open_or_create_subdir: between stat_at returning NotFound and mkdir_at, another process can create the directory, so our mkdir_at returns EEXIST. Retry the stat to open the directory the other process created.

#11505 also edits this function for a different concern (symlink-following per #11469); the two changes touch separate branches and rebase cleanly either way.

Concurrent install -D invocations sharing parent directories race in
open_or_create_subdir between stat_at returning NotFound and mkdir_at.
Another process can create the directory in that gap, so our mkdir_at
returns EEXIST. Retry the stat to open the directory the other process
created.

Fixes uutils#12355.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/date/resolution (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/symlink (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/csplit/csplit-heap is now being skipped but was previously passing.

)),
};
}
Err(e) if e.kind() == io::ErrorKind::NotFound => match parent_fd.mkdir_at(name, mode) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, added comments on the create and retry arms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install -D loses some files to EEXIST

2 participants