Skip to content

Commit

Permalink
fix: bad read by wrong data region
Browse files Browse the repository at this point in the history
    User io may involve discontinuous segments in different chunks. Bad
    read is produced by merging them into continuous one. That is what
    Region does. This pr separate discontinuous segments into different
    regions, avoiding merging forcibly.

Signed-off-by: 泰友 <[email protected]>
  • Loading branch information
泰友 committed Mar 27, 2024
1 parent 02bd6a7 commit 58de577
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions storage/src/cache/cachedfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,7 @@ mod tests {

let tag = BlobIoTag::User(BlobIoSegment {
offset: 0x1800,
len: 0x1800,
len: 0x800,
});
state
.push(RegionType::CacheFast, 0x1000, 0x2000, tag, None)
Expand All @@ -1597,8 +1597,8 @@ mod tests {
assert_eq!(state.regions.len(), 1);

let tag = BlobIoTag::User(BlobIoSegment {
offset: 0x0000,
len: 0x2000,
offset: 0x0001,
len: 0x1fff,
});
state
.push(RegionType::CacheSlow, 0x5000, 0x2000, tag, None)
Expand Down

0 comments on commit 58de577

Please sign in to comment.