mirror of
https://github.com/apache/nuttx.git
synced 2026-08-14 00:43:13 +00:00
cromfs_read()'s fast path decompresses a block directly into the caller's buffer whenever a read reaches a block at its start and the caller has room for the whole decompressed block, bypassing the per-file decompression cache (ff_buffer). It nonetheless marked that block as cached by setting ff_offset, without ever writing ff_buffer itself. A later read of the same block that fell onto the slow path trusted that false cache tag, skipped decompression, and copied from ff_buffer without it ever having been populated for that block. A repeated identical fast-path read of the same block hit the same false tag and skipped decompression entirely, leaving the caller's buffer untouched and returning whatever was already there. Fixed by having the fast path only read the cache, never populate it: reuse ff_buffer when a prior slow-path read already cached the same block, otherwise decompress straight into the caller's buffer without touching ff_offset/ff_buffer. Co-authored-by: Pavlo Assisted-by: Claude Code:claude-sonnet-5 Signed-off-by: alexcekay <alexander@auterion.com> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| cromfs.h | ||
| fs_cromfs.c | ||
| Kconfig | ||
| Make.defs | ||