-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fs: littlefs: Fix cache and lookahead size checks in littlefs_fs for block devices #82880
fs: littlefs: Fix cache and lookahead size checks in littlefs_fs for block devices #82880
Conversation
I'm interested in why cache and lookahead buffer values are being reduced, especially when buffers have been already assigned. |
17bfe5d
to
e729977
Compare
This fixes an issue where wrong values were checked against block device defaults. Kconfig values are used when no filesystem config values are provided, and the buffers are sized according to the Kconfig values, but the checks were only performed against filesystem config variables. Signed-off-by: Djordje Nedic <[email protected]>
e729977
to
84c3740
Compare
To align with block size of a device: 09574e6 |
The default are only used when not instance specific not provided. |
In that case wouldn't it make more sense to round down to the closest smaller multiple of block size? With a cache size set to 2047, it will still be reduced to 512 despite 1536 being smaller than 2047 and a multiple of 512. |
Exactly, however in this case we are only checking against instance specific, which is 0 when nothing is provided. |
Ah, right. There is a bug because the |
I'm also going to submit a new PR to change the block alignment behavior for these values, but it might be better to merge this as a quick fix since it breaks using block devices without instance specific configs or devicetree defined. |
This fixes an issue where wrong values were checked against block device defaults. Kconfig values are used when no filesystem config values are provided, and the buffers are sized according to the Kconfig values, but the checks were only performed against filesystem instance specific config variables.