Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fs: littlefs: Gracefully fail when static buffers are too small
The cache_size and lookahead_size are set at compile time using the CONFIG_FS_LITTLEFS_CACHE_SIZE and CONFIG_FS_LITTLEFS_LOOKAHEAD_SIZE values from Kconfig, or from the cache-size and lookahead-size properties in a 'zephyr,fstab,littlefs' compatible in the devicetree. Those values are also used to statically allocate buffers that are pointed at by the read_buffer, prog_buffer, and lookahead_buffer members of the lfs_config structure. At runtime, when using a block device, the cache_size and lookahead_size are updated to be multiples of the underlying block device's block_size, which may make them bigger than the original size used to allocate the static buffers. Log an error and fail the operation when this occurs. Signed-off-by: Phil Hindman <[email protected]>
- Loading branch information