Skip to content

littlefs: Too small heap for file cache. #31524

@r2r0

Description

@r2r0

Describe the bug
fs_open for CONFIG_FS_LITTLEFS_NUM_FILESth file returns -ENOMEM.
I.e. CONFIG_FS_LITTLEFS_NUM_FILES=3 and when fs_open is caled for 3rd file it returns -ENOMEM.
After incrementing CONFIG_FS_LITTLEFS_NUM_FILES and opening only CONFIG_FS_LITTLEFS_NUM_FILES-1 files problem is not present.
After increasing file_cache_pool (in littlefs_fs.c) even by 128 bytes problem is not present (CONFIG_FS_LITTLEFS_NUM_FILES=3).

To Reproduce
Try to open at the same time CONFIG_FS_LITTLEFS_NUM_FILES number of files on littleFS.

Expected behavior
No error from fs_open.

Impact
annoyance

Logs and console output
None
Environment (please complete the following information):

  • OS: Linux
  • ToolchainZephyr SDK 0.12.1
  • Commit SHA c31ce55

Additional context
Maybe commit fcd392f caused this problem because heap size available to user != declared size of heap.

Metadata

Metadata

Assignees

Labels

area: File SystembugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions