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

Make posix_fallocate robust against interruption, report right errors #2905

Merged
merged 1 commit into from
Oct 20, 2017

Conversation

ironage
Copy link
Contributor

@ironage ironage commented Oct 19, 2017

man posix_fallocate states:

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

With this in mind, we should report the return value and not the value in errno.

Additionally, EINTR is reported as a return code in fedora 24 (but strangely not mentioned in ubuntu 16). If it is interrupted, we can retry. It is hard to guess what the result of an interrupted posix_fallocate call would result in if not retried; the file would not be the expected size so this may fix errors like #2258.

@realm-ci
Copy link
Contributor

@codecov-io
Copy link

Codecov Report

Merging #2905 into master will increase coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2905      +/-   ##
==========================================
+ Coverage   92.62%   92.62%   +<.01%     
==========================================
  Files         245      245              
  Lines       75787    75790       +3     
  Branches     4346     4347       +1     
==========================================
+ Hits        70194    70197       +3     
  Misses       5250     5250              
  Partials      343      343
Impacted Files Coverage Δ
src/realm/util/file.cpp 76.11% <50%> (+0.11%) ⬆️
test/test_thread.cpp 81.35% <0%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 485aaae...ecb81ae. Read the comment docs.

Copy link
Contributor

@kspangsege kspangsege left a comment

Choose a reason for hiding this comment

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

👍

@ironage ironage merged commit 91eb075 into master Oct 20, 2017
@ironage ironage deleted the js/posix_fallocate-failures branch October 20, 2017 16:52
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants