Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lfs_alloc() blocks on full filesystem. #1063

Open
ddomnik opened this issue Jan 11, 2025 · 0 comments
Open

lfs_alloc() blocks on full filesystem. #1063

ddomnik opened this issue Jan 11, 2025 · 0 comments

Comments

@ddomnik
Copy link

ddomnik commented Jan 11, 2025

This issue is derived from this Espressif port: joltwallet/esp_littlefs#213 But I think it most likely fits better here.

Usually on a full filesystem littleFS returns from fwrite() within a few ms and prints:
E (2818207) esp_littlefs: ./managed_components/joltwallet__littlefs/src/littlefs/lfs.c:689:error: No more free space 0x48d

However, it could happen that the library gets "stuck" for a very long time (multiple seconds or even minutes - prob. depending on partition size). This happens exactly in this while loop. (The second while in lfs_alloc())

littlefs/lfs.c

Line 656 in d01280e

while (lfs->lookahead.next < lfs->lookahead.size) {

The problem is, that almost every program uses watchdogs. Espressifs default watchdog has a maximum of 60 seconds, which seems to be insufficient in rare cases and then resets the whole device. maximum wdt timeout

Maybe some experts know how to handle this issue.

Based on my current understanding of the issue, a very simple thought would be to give littleFs it's own watchdog that can be set. This allows to "catch" the issue on application level rather than system level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant