cleanup(fs): stricter check for buffer chunks count and minor improvements#10117
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #10117 +/- ##
=======================================
Coverage 82.6% 82.6%
=======================================
Files 845 845
Lines 317132 317134 +2
=======================================
+ Hits 261967 261982 +15
+ Misses 55165 55152 -13 🚀 New features to boost your workflow:
|
kskalski
commented
Jan 20, 2026
| buffer | ||
| .chunks_exact_mut(chunk_size as usize) | ||
| .map(move |buf| { | ||
| let io_buf_index = (buf.as_ptr() as usize - buf_start) / FIXED_BUFFER_LEN as usize; | ||
| let io_buf_index = (buf.as_ptr().addr() - buf_start) / FIXED_BUFFER_LEN as usize; |
Author
There was a problem hiding this comment.
this is now compatible with the way buf_start is calculated in line 211
eecdebc to
c119ed2
Compare
Author
|
this was supposed to be part of #9701, missed pushing changes from my local repo.. :/ |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
u16is used for index of buffer chunks (IoBufferChunk), e.g. inFileStatethere isstart_buf_index: Option<u16>,However we don't validate that dividing original buffer into chunks won't exceed limit of
u16.Summary of Changes
buffer.len()bychunk_sizedoesn't exceedu16::MAX(also add check thatchunk_sizeis not larger thanFIXED_BUFFER_LEN)u32types in function signatures to proper type aliasIoSize