Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fallocate sets errno on error, posix_fallocate did not #60185

Merged
merged 1 commit into from
Oct 11, 2021

Conversation

adamsitnik
Copy link
Member

minor issue that I've found when reviewing #59338

On success, fallocate() returns zero. On error, -1 is returned
and errno is set to indicate the error.

posix_fallocate() returns zero on success, or an error number on
failure. Note that errno is not set.

@adamsitnik adamsitnik added this to the 7.0.0 milestone Oct 8, 2021
@adamsitnik adamsitnik requested review from tmds and jozkee October 8, 2021 16:15
@ghost
Copy link

ghost commented Oct 8, 2021

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

minor issue that I've found when reviewing #59338

On success, fallocate() returns zero. On error, -1 is returned
and errno is set to indicate the error.

posix_fallocate() returns zero on success, or an error number on
failure. Note that errno is not set.

Author: adamsitnik
Assignees: -
Labels:

area-System.IO

Milestone: 7.0.0

@jozkee
Copy link
Member

jozkee commented Oct 8, 2021

@adamsitnik should this be backported?

@adamsitnik
Copy link
Member Author

should this be backported?

Currently it will stop on first error, with my fix it's going to actually retry on interrupt which should be super rare. Since we ignore most of the fallocate failures, the preallocationSize is just going to be ignored.

I don't have a strong opinion about this, but I would rather say no.

Copy link
Member

@tmds tmds left a comment

Choose a reason for hiding this comment

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

nice catch, thanks!

@adamsitnik adamsitnik merged commit 4a42b37 into dotnet:main Oct 11, 2021
@adamsitnik adamsitnik deleted the lastError branch October 11, 2021 07:15
@ghost ghost locked as resolved and limited conversation to collaborators Nov 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants