-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a fallback path if renameat2 fails (#2733)
Motivation: 'renameat2' can fail with EINVAL if the RENAME_NOREPLACE flag isn't supported. However, not all kernel versions support this flag which can result in an error when creating a file 'transactionally'. Using 'renameat2' only happens on Linux as a fallback when O_TMPFILE isn't available. Modifications: - On Linux, fallback to a combination of 'stat' and 'rename' if 'renameat2' fails with EINVAL. - Add a couple of tests Result: Files can still be created exclusively
- Loading branch information
Showing
2 changed files
with
124 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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