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
Handle the result of posix_fallocate system call #15650
Conversation
OR-ing the fallback version with linux might be clearer than sticking in a bunch of returns and leaving in a chunk of dead code that some static analysis tools may warn about. |
Do you think we can consider the Linux part in the fallback? I don't know if posix_allocate can be called on every platform. It will become something like:
This way the system call |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
No but you can do |
0e7e234
to
eb18d9a
Compare
This sounds great. I indent the nested #if to be consistent with the style of the rest of the code. I also add here a link for reference to the first introduction of the system call: #2229. |
Style ACK. :) (should get some testing on an impacted filesystem) |
utACK eb18d9a |
eb18d9a
to
7806259
Compare
Just tested on an affected filesystem (unionf on Debian stable), using strace to check the system calls sent to the system. The success return value of posix_fallocate is obviously zero. Somehow in a previous version I had the '!', but then I pushed the wrong one, without it. I've just force-pushed the good version, I've just tested with strace. Affected filesystem (fallocate result is EOPNOTSUPP, and the fallback code is activated):
Ext4 filesystem (fallocate result is zero, that means success, and no other code is activated):
|
7806259
to
5d35ae3
Compare
Gitian builds for commit 7b13c64 (master):
Gitian builds for commit a48eb1b (master and this pull):
|
utACK 5d35ae3 |
utACK 5d35ae3, though the Yoda condition is an uncommon style in this project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably would be better to have configure check for posix_fallocate
availability instead of using __linux__
, but since it's already that way, this is strictly an improvement.
utACK
utACK 5d35ae3 |
1 similar comment
utACK 5d35ae3 |
5d35ae3 Handle the result of posix_fallocate system call (Luca Venturini) Pull request description: The system call `posix_fallocate` is not supported on some filesystems. - catches the result of posix_allocate and fall back to the default behaviour if the return value is different from 0 (success) Fixes #15624 ACKs for commit 5d35ae: MarcoFalke: utACK 5d35ae3 sipa: utACK 5d35ae3, though the Yoda condition is an uncommon style in this project. hebasto: utACK 5d35ae3 practicalswift: utACK 5d35ae3 Tree-SHA512: 7ab3b35fb633926f28a58b2b07ffde8e31bb997c80a716b1b45ee716fe9ff4ddcef0a05810bd4423530e220cfc62f8925517d27a8b92b05a524272063e43f746
5d35ae3 Handle the result of posix_fallocate system call (Luca Venturini) Pull request description: The system call `posix_fallocate` is not supported on some filesystems. - catches the result of posix_allocate and fall back to the default behaviour if the return value is different from 0 (success) Fixes bitcoin#15624 ACKs for commit 5d35ae: MarcoFalke: utACK 5d35ae3 sipa: utACK 5d35ae3, though the Yoda condition is an uncommon style in this project. hebasto: utACK 5d35ae3 practicalswift: utACK 5d35ae3 Tree-SHA512: 7ab3b35fb633926f28a58b2b07ffde8e31bb997c80a716b1b45ee716fe9ff4ddcef0a05810bd4423530e220cfc62f8925517d27a8b92b05a524272063e43f746
Github-Pull: bitcoin#15650 Rebased-From: 5d35ae3
Github-Pull: bitcoin#15650 Rebased-From: 5d35ae3
Github-Pull: bitcoin#15650 Rebased-From: 5d35ae3
0b18ea6 util: Filter control characters out of log messages (Wladimir J. van der Laan) ac30fc4 build: Factor out qt translations from build system (Wladimir J. van der Laan) 3b8af5f build: update boost macros to latest upstream (fanquake) b12defc Test that joinpsbts randomly shuffles the inputs (Andrew Chow) eb07d22 Shuffle inputs and outputs after joining psbts (Andrew Chow) 1175410 addrdb: Remove temporary files created in SerializeFileDB. Fixes non-determinism in unit tests. (practicalswift) c52dd12 Handle the result of posix_fallocate system call (Luca Venturini) f792b25 torcontrol: Use the default/standard network port for Tor hidden services, even if the internal port is set differently (Luke Dashjr) 9fe8d28 Bugfix: QA: Run tests with UPnP disabled (Luke Dashjr) 1d12e52 Add vertical spacer (Josu Goñi) d764141 depends: add patch to common dependencies (fanquake) 56815e9 Give QApplication dummy arguments (Andrew Chow) 9d389d0 util: No translation of `Bitcoin Core` in the copyright (MarcoFalke) 87908e9 scripted-diff: Avoid passing PACKAGE_NAME for translation (MarcoFalke) a44e18f build: Stop translating PACKAGE_NAME (MarcoFalke) 7bd8f4e rpc: Fix getblocktemplate CLI example (#16594) (Emil Engler) 1cc06a1 doc: Fix typos in COPYRIGHT (Chuf) Pull request description: Backports some commits to the `0.18` branch: * #16596 - rpc: Fix getblocktemplate CLI example * #16615 - doc: Fix typos in COPYRIGHT * #16291 - gui: Stop translating PACKAGE_NAME (without the `make translate` commit) * #16578 - Do not pass in command line arguments to QApplication * #16051 - depends: add patch to common dependencies * #16090 - Add vertical spacer * #15651 - torcontrol: Use the default/standard network port for Tor hidden services, even if the internal port is set differently * #15650 - Handle the result of posix_fallocate system call * #16646 - Bugfix: QA: Run tests with UPnP disabled * #16212 - addrdb: Remove temporary files created in SerializeFileDB. Fixes non-determinism in unit tests. * #16512 - rpc: Shuffle inputs and outputs after joining psbts * #16870 - build: update boost macros to latest upstream for improved error reporting * #16982 - build: Factor out qt translations from build system * #17095 - util: Filter control characters out of log messages ACKs for top commit: laanwj: ACK 0b18ea6 Tree-SHA512: 37f0e5afc20975f4d1506e8662eda2ae0125f2f424a852818b5af2c3b8db78fc1c365b83571aa80ca63c885ca314302190b891a50ff3851fda9b9238455a5627
5d35ae3 Handle the result of posix_fallocate system call (Luca Venturini) Pull request description: The system call `posix_fallocate` is not supported on some filesystems. - catches the result of posix_allocate and fall back to the default behaviour if the return value is different from 0 (success) Fixes bitcoin#15624 ACKs for commit 5d35ae: MarcoFalke: utACK 5d35ae3 sipa: utACK 5d35ae3, though the Yoda condition is an uncommon style in this project. hebasto: utACK 5d35ae3 practicalswift: utACK 5d35ae3 Tree-SHA512: 7ab3b35fb633926f28a58b2b07ffde8e31bb997c80a716b1b45ee716fe9ff4ddcef0a05810bd4423530e220cfc62f8925517d27a8b92b05a524272063e43f746
5d35ae3 Handle the result of posix_fallocate system call (Luca Venturini) Pull request description: The system call `posix_fallocate` is not supported on some filesystems. - catches the result of posix_allocate and fall back to the default behaviour if the return value is different from 0 (success) Fixes bitcoin#15624 ACKs for commit 5d35ae: MarcoFalke: utACK 5d35ae3 sipa: utACK 5d35ae3, though the Yoda condition is an uncommon style in this project. hebasto: utACK 5d35ae3 practicalswift: utACK 5d35ae3 Tree-SHA512: 7ab3b35fb633926f28a58b2b07ffde8e31bb997c80a716b1b45ee716fe9ff4ddcef0a05810bd4423530e220cfc62f8925517d27a8b92b05a524272063e43f746
5d35ae3 Handle the result of posix_fallocate system call (Luca Venturini) Pull request description: The system call `posix_fallocate` is not supported on some filesystems. - catches the result of posix_allocate and fall back to the default behaviour if the return value is different from 0 (success) Fixes bitcoin#15624 ACKs for commit 5d35ae: MarcoFalke: utACK 5d35ae3 sipa: utACK 5d35ae3, though the Yoda condition is an uncommon style in this project. hebasto: utACK 5d35ae3 practicalswift: utACK 5d35ae3 Tree-SHA512: 7ab3b35fb633926f28a58b2b07ffde8e31bb997c80a716b1b45ee716fe9ff4ddcef0a05810bd4423530e220cfc62f8925517d27a8b92b05a524272063e43f746
5d35ae3 Handle the result of posix_fallocate system call (Luca Venturini) Pull request description: The system call `posix_fallocate` is not supported on some filesystems. - catches the result of posix_allocate and fall back to the default behaviour if the return value is different from 0 (success) Fixes bitcoin#15624 ACKs for commit 5d35ae: MarcoFalke: utACK 5d35ae3 sipa: utACK 5d35ae3, though the Yoda condition is an uncommon style in this project. hebasto: utACK 5d35ae3 practicalswift: utACK 5d35ae3 Tree-SHA512: 7ab3b35fb633926f28a58b2b07ffde8e31bb997c80a716b1b45ee716fe9ff4ddcef0a05810bd4423530e220cfc62f8925517d27a8b92b05a524272063e43f746
5d35ae3 Handle the result of posix_fallocate system call (Luca Venturini) Pull request description: The system call `posix_fallocate` is not supported on some filesystems. - catches the result of posix_allocate and fall back to the default behaviour if the return value is different from 0 (success) Fixes bitcoin#15624 ACKs for commit 5d35ae: MarcoFalke: utACK 5d35ae3 sipa: utACK 5d35ae3, though the Yoda condition is an uncommon style in this project. hebasto: utACK 5d35ae3 practicalswift: utACK 5d35ae3 Tree-SHA512: 7ab3b35fb633926f28a58b2b07ffde8e31bb997c80a716b1b45ee716fe9ff4ddcef0a05810bd4423530e220cfc62f8925517d27a8b92b05a524272063e43f746
5d35ae3 Handle the result of posix_fallocate system call (Luca Venturini) Pull request description: The system call `posix_fallocate` is not supported on some filesystems. - catches the result of posix_allocate and fall back to the default behaviour if the return value is different from 0 (success) Fixes bitcoin#15624 ACKs for commit 5d35ae: MarcoFalke: utACK 5d35ae3 sipa: utACK 5d35ae3, though the Yoda condition is an uncommon style in this project. hebasto: utACK 5d35ae3 practicalswift: utACK 5d35ae3 Tree-SHA512: 7ab3b35fb633926f28a58b2b07ffde8e31bb997c80a716b1b45ee716fe9ff4ddcef0a05810bd4423530e220cfc62f8925517d27a8b92b05a524272063e43f746
5d35ae3 Handle the result of posix_fallocate system call (Luca Venturini) Pull request description: The system call `posix_fallocate` is not supported on some filesystems. - catches the result of posix_allocate and fall back to the default behaviour if the return value is different from 0 (success) Fixes bitcoin#15624 ACKs for commit 5d35ae: MarcoFalke: utACK 5d35ae3 sipa: utACK 5d35ae3, though the Yoda condition is an uncommon style in this project. hebasto: utACK 5d35ae3 practicalswift: utACK 5d35ae3 Tree-SHA512: 7ab3b35fb633926f28a58b2b07ffde8e31bb997c80a716b1b45ee716fe9ff4ddcef0a05810bd4423530e220cfc62f8925517d27a8b92b05a524272063e43f746
The system call
posix_fallocate
is not supported on some filesystems.Fixes #15624