-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(virtio-block): Add fallocate support #5511
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
base: main
Are you sure you want to change the base?
feat(virtio-block): Add fallocate support #5511
Conversation
|
also disclaimer this still needs to be style checked, but this should be the near final implementation, other than writing a more rigorous testing suite. |
41e7941 to
abda29f
Compare
|
@bchalios @ShadowCurse whenever you have time do y'all mind taking a look? I really want to bring this issue to the finish line, thanks! |
ShadowCurse
left a comment
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.
Sorry for late review. Did a first pass and left some comments. One thing we need to think about is the fact that fallocate is not supported on all filesystems, so either we need to make this feature optional for the device, or make failures to fallocate to just print error logs and not return actual errors.
| pub fn fallocate(fd: c_int, mode: i32, offset: off64_t, len: off64_t) -> Result<(), std::io::Error> { | ||
| let ret: i32 = unsafe { libc::fallocate(fd, mode, offset, len) }; | ||
| if ret == 0 { | ||
| Ok(()) | ||
| } else { | ||
| Err(std::io::Error::last_os_error()) | ||
| } | ||
| } |
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.
Is this used anywhere?
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.
ack, forgot to remove this earlier. Will do.
|
Hi, sorry for the late response, but I will get this handled within the next day or two and mark for another review. Thanks! |
8fd863f to
dacdcff
Compare
- Updated unmap/fstrim/discard deprecated logic. Signed-off-by: LDagnachew <[email protected]>
- fallocate unblocked in seccomp, thus allowing discard requests. Signed-off-by: LDagnachew <[email protected]>
Update Python files to comply with Black and pylint checks. These changes are formatting-only and do not alter functionality. Signed-off-by: LDagnachew <[email protected]>
- added safety comments + minor error handling. Signed-off-by: LDagnachew <[email protected]>
f23cb9b to
dd0a7e1
Compare
Changes
fallocate.Reason
Attempting to resolve Issue #2708.
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.PR Checklist
tools/devtool checkbuild --allto verify that the PR passesbuild checks on all supported architectures.
tools/devtool checkstyleto verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md.Runbook for Firecracker API changes.
integration tests.
TODO.rust-vmm.