Skip to content

Commit

Permalink
Fix filesystem corruption
Browse files Browse the repository at this point in the history
LittleFS bindings reported too big lookahead cache size which resulted
in corrupting adjacent structures (read and prog buffer, other data),
which in turn resulted in filesystem corruption either by reallocating
an already allocated causing cycle or by corrupting data before writing
it to disk.
  • Loading branch information
arturkow2000 committed Jun 30, 2022
1 parent 3110912 commit 7514184
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl<Storage: driver::Storage> Allocation<Storage> {
let block_size: u32 = Storage::BLOCK_SIZE as _;
let cache_size: u32 = <Storage as driver::Storage>::CACHE_SIZE::U32;
let lookahead_size: u32 =
32 * <Storage as driver::Storage>::LOOKAHEADWORDS_SIZE::U32;
4 * <Storage as driver::Storage>::LOOKAHEADWORDS_SIZE::U32;
let block_cycles: i32 = Storage::BLOCK_CYCLES as _;
let block_count: u32 = Storage::BLOCK_COUNT as _;

Expand Down

0 comments on commit 7514184

Please sign in to comment.